qiyuangong / leetcode Goto Github PK
View Code? Open in Web Editor NEWPython & JAVA Solutions for Leetcode
License: MIT License
Python & JAVA Solutions for Leetcode
License: MIT License
I have tried the solution of Leetcode 146, and it shows wrong answer?
[ ] Upgrade from Python 2 to Python3
if len(linklist)<n there is error
I believe including question itself as comment in the solution code will be good...
I tried to run this code in python 3, and the result is not correct.
since the default number structure is float in python 3, I changed the code as bellow:
`class Solution(object):
def isPalindrome(self, x):
if x < 0:
return False
ls = len(str(x))
tmp = x
print((int(ls/2)))
for i in range(int(ls/2)):
right = int(tmp % 10)
left = tmp / (10 ** (ls - 2 * i - 1))
left = int(left % 10)
print (left, right)
if left != right:
return False
tmp = tmp // 10
return True
if name == 'main':
# begin
s = Solution()
print (s.isPalindrome(10000100001))`
Thank you.
TypeError: 'float' object cannot be interpreted as an integer
leetcode/python/012_Integer_to_Roman.py
Line 38 in 0564594
Hello, I watched that there is a short explanation of various problems through readme.
In this regard, it would be better if repository users could distinguish the problem by algorithm.
Therefore, I would like to add the problem classification according to the algorithm to readme.
Is it okay to add this classification function?
Could you please also add my LeetCode solutions repo in the other leetcode section.
Have a look at it over here: leetcode-algorithms
It contains solutions in java and python and also video descriptions of the algorithm.
Hi, I just check a code for Q7. Reverse Integer and it gives wrong answer in the test case.
So, Can I make some changes in this code?
And, In old codes there are some test case code in main.
Can I update this code by erasing?
It's shows wrong answer
Wrong Answer
Runtime: 36 ms
Hi, I noticed that the current solution for 007_Reverse_Integer.py is using string. I am wondering if it is possible that we also add a bitwise method (basically checking if the last bit is 1, and shift the binary string << 1 every time), which could be more proper here. I can add this method if that is ok.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.