摘要:
Problem: Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements. For exa 阅读全文
摘要:
Problem: Given two arrays, write a function to compute their intersection. Example: Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2]. Note: Each 阅读全文
摘要:
Problem: Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the f 阅读全文
摘要:
Problem: Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. For example: Given num = 38, the process 阅读全文
摘要:
Problem: 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 阅读全文
摘要:
Problem: Write a function that takes a string as input and returns the string reversed. Example: Given s = "hello", return "olleh". One possible Solut 阅读全文