摘要: public class Solution { private String[] lessThanTwenty = { "", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven 阅读全文
posted @ 2022-01-28 06:20 阳光明媚的菲越 阅读(21) 评论(0) 推荐(0) 编辑
摘要: To solve this problem, we need two steps: 1. Convert "order" string to a Hashmap, the key is the characor in the "order" string, value is its index. 2 阅读全文
posted @ 2022-01-28 04:54 阳光明媚的菲越 阅读(22) 评论(0) 推荐(0) 编辑
摘要: 这道题是典型的括号题,一般来说,括号题用stack做,但是这道题因为太简单了,连stack都不用, 就用int就好了,时间复杂度O(n)。 public int minAddToMakeValid(String s) { int count = 0; int res = 0; for(int i=0 阅读全文
posted @ 2022-01-28 04:31 阳光明媚的菲越 阅读(19) 评论(0) 推荐(0) 编辑