摘要: 每个按钮有凹和凸两种状态,则n个按钮的状态总数为2n,显然使用暴力解法会超出时间限制。显而易见,同一个按钮按两次不会有任何效果,因此每个按钮最多的操作次数只能为1。不妨用数组status[n+2]表示按钮的状态,result[n+2]表示期望的目标状态,元素的取值限定为0和1,那么st 阅读全文
posted @ 2018-07-05 08:13 NaiveCoder 阅读(424) 评论(0) 推荐(0)
摘要: 台湾大学林轩田老师讲授的《机器学习基石》、《机器学习技法》两门公开课在两岸三地享有盛誉,造福了许多机器学习小白。作为小白中的一员,八月中旬的时候我有幸学习了《机器学习基石》,感到受益匪浅。林老师授课深入浅出,循循善诱,自觉跟着林老师的脚步也能窥测machine learning这个神奇大世界的一二门 阅读全文
posted @ 2017-11-10 20:24 NaiveCoder 阅读(257) 评论(0) 推荐(0)
摘要: Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example: Example: 阅读全文
posted @ 2017-06-17 11:07 NaiveCoder 阅读(93) 评论(0) 推荐(0)
摘要: Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which the leng 阅读全文
posted @ 2017-06-16 10:25 NaiveCoder 阅读(106) 评论(0) 推荐(0)
摘要: Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in the 阅读全文
posted @ 2017-06-14 21:38 NaiveCoder 阅读(113) 评论(0) 推荐(0)
点击右上角即可分享
微信分享提示