1. Leetcode 9 Palindrome Number

    Leetcode 9 Palindrome Number Determine whether an integer is a palindrome. Do this without extra space. click to show spoilers. Some hints: Could negative integers be palindromes? (ie, -1) If you are thinking of converting the integer to string, note the restriction of using extra space. You could also try…


  2. Leetcode 292 Nim Game

    Leetcode 292 Nim Game You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 stones. The one who removes the last stone will be the winner. You will take…


  3. Leetcode 112 Path Sum

    Leetcode 112 Path Sum Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. For example: Given the below binary tree and sum = 22, 5 / \ 4 8 / / \ 11 13 4 / \ \ 7…


  4. Whose view is not in the window hierarchy!

    This time, when I was doing a ship battle game for iOS in XCode with objective-c, it shows a very interesting warning. 2015-10-15 16:05:59.278 Lyu-Lab5[4505:1418041] Warning: Attempt to present on whose view is not in the window hierarchy! I tried to find solutions towards this…

    on ios

  5. Leetcode 134 Gas Station

    Leetcode 134 Gas Station There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from station i to its next station (i+…

    on Greedy