上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 49 下一页
摘要: Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. Example: Note: 1: You may assume that the array 阅读全文
posted @ 2018-12-03 21:34 A-Little-Nut 阅读(93) 评论(0) 推荐(0) 编辑
摘要: Given an unsorted array of integers, find the length of longest increasing subsequence. For example, Given [10, 9, 2, 5, 3, 7, 101, 18], The longest i 阅读全文
posted @ 2018-12-03 21:33 A-Little-Nut 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 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 ston 阅读全文
posted @ 2018-12-03 21:31 A-Little-Nut 阅读(100) 评论(0) 推荐(0) 编辑
摘要: 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 example, giv 阅读全文
posted @ 2018-12-03 15:21 A-Little-Nut 阅读(119) 评论(0) 推荐(0) 编辑
摘要: Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n. For example, given n = 12, 阅读全文
posted @ 2018-12-03 15:20 A-Little-Nut 阅读(113) 评论(0) 推荐(0) 编辑
摘要: Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array. Note: Your algorithm should run 阅读全文
posted @ 2018-12-03 15:19 A-Little-Nut 阅读(111) 评论(0) 推荐(0) 编辑
摘要: Write a program to find the n th ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 1, 2, 3, 4, 5, 阅读全文
posted @ 2018-12-03 15:17 A-Little-Nut 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 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 is like: 阅读全文
posted @ 2018-12-03 15:16 A-Little-Nut 阅读(107) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return all root to leaf paths. Note: A leaf is a node with no children. Example: 阅读全文
posted @ 2018-12-03 15:15 A-Little-Nut 阅读(90) 评论(0) 推荐(0) 编辑
摘要: Given two strings s and t, write a function to determine if t is an anagram of s. For example, s = “anagram”, t = “nagaram”, return true. s = “rat”, t 阅读全文
posted @ 2018-12-03 15:12 A-Little-Nut 阅读(102) 评论(0) 推荐(0) 编辑
上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 49 下一页