Giter Site home page Giter Site logo

leetcode's Issues

Add new function

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?

009_Palindrome_Number.py in python 3

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.

Add Bitwise solution for Python 007_Reverse_Integer.py

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.

New Problem

image

I have this problem can you solve this. If you can please tell me the pseudocode or algorithm, please.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.