摘要:
公众号:爱写bug(ID:icodebugs) 翻转字符串里的单词 Given an input string, reverse the string word by word. 示例 1: 示例 2: 示例 3: 说明: 无空格字符构成一个单词。 输入字符串可以在前面或者后面包含多余的空格,但是反 阅读全文
摘要:
公众号: 爱写bug(ID:icodebugs) 作者:爱写bug 给定一个含有 n 个正整数的数组和一个正整数 s , 找出该数组中满足其和 ≥ s 的长度最小的连续子数组 。 如果不存在符合条件的连续子数组,返回 0。 Given an array of n positive integers 阅读全文
摘要:
公众号:爱写bug(ID:icodebugs) 给定一个数组,将数组中的元素向右移动 k 个位置,其中 k 是非负数。 Given an array, rotate the array to the right by k steps, where k is non negative. 示例 1: 示 阅读全文
摘要:
公众号:爱写bug(ID:icodebugs) 作者:爱写bug 给定一个非负索引 k ,其中 k ≤ 33,返回杨辉三角的第 k 行。 Given a non negative index k where k ≤ 33, return the k th index row of the Pasca 阅读全文
摘要:
算法是一个程序的灵魂 公众号:爱写bug(ID:icodebugs) 作者:爱写bug 给定一个含有 n 个正整数的数组和一个正整数 s , 找出该数组中满足其和 ≥ s 的长度最小的连续子数组 。 如果不存在符合条件的连续子数组,返回 0。 Given an array of n positive 阅读全文
摘要:
文章全部来自公众号:爱写bug 算法是一个程序的灵魂。 Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), ..., 阅读全文