Leetcode 467. Unique Substrings in Wraparound String

题目链接:Unique Substrings in Wraparound String
这里加段英文,不是为了凑字数,而是为了让别人搜索题目的时候能搜到我的博客。。
Consider the string s to be the infinite wraparound string of “abcdefghijklmnopqrstuvwxyz”, so s will look like this: “…zabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd….”.
Continue reading

Leetcode 368. Largest Divisible Subset

题目链接:368. Largest Divisible Subset

Given a set of distinct positive integers, find the largest subset such that every pair (Si, Sj) of elements in this subset satisfies: Si % Sj = 0 or Sj % Si = 0.
If there are multiple solutions, return any subset is fine.
  题目意思也很简单,给出一个不含重复数字的数组,找到最长的一个子数组,子数组里的元素必须两两整除。
Continue reading