Weekly Contest 目前是北京时间每周日上午 10 点半到 12点,目前参加了 9 次。
每周参加weekly contest,发现前几名都会在半小时左右完成4题,我感觉对于一道陌生的MEDIUM题目,理解+思考...
classSolution {public:intdayOfYear(stringdate) { vector<int> days_run = {31,29,31,30,31,30,31,31,30,31,30,31}; vector<int> days_ping = {31,28,31,30,31,30,31,31,30,31,30,31};intyear = -1;intmonth = -1;intday = -1; date.push_back('-');stringstr;for(auto&ch : d...
Given an array of 4 digits, return the largest 24 hour time that can be made. The smallest 24 hour time is 00:00, and the largest is 23:59. Starting from 00:00, a time is larger if more time has elapsed since midnight. Return the answer as a string of length 5. If no valid ...
链接:https://leetcode-cn.com/contest/weekly-contest-90/problems/minimum-cost-to-hire-k-workers/ 分析: 速度有点慢,最后20分钟开始处理,没想太多,测试数据到第41个超时了,O(n*n)毫无前途。 TimeOut COde: 1classSolution {2public:3doublemincostToHireWorkers(vector<int>& quality, vector<int>& wag...
LeetCode笔记:Biweekly Contest 90 1. 题目一 给出题目一的试题链接如下: 2451. Odd String Difference 1. 解题思路 这一题的题目难度感觉全在读题上面,看懂了题目基本就是按照题意翻译一下就行。 找到每一个单词的pattern,然后将唯一一个pattern不同string挑选出来返回即可。
https://leetcode-cn.com/contest/weekly-contest-174/ranking/1/ 总体心得 使用python3,做成了第一道题,第二道题的解超时,便结束了第一次周赛。 下午看了排行榜靠前的参赛者代码,最快的在17分钟内就完赛了(使用python3),使用python3的和c++的数量几乎对半分。
给你一个字符串 s,找出它的所有子串并按字典序排列,返回排在最后的那个子串。 示例1: 输入:"abab" 输出:"bab" 解释:我们可以找出 7 个子串 ["a", "ab", "aba", "abab", "b", "ba", "bab"]。按字典序排在最后的子串是 "bab"。
又是一个周末,第一次参加leetcode的weekly-contest。早上起的晚了,匆匆忙忙打开室友的电脑(恩,他不在,也没有密码),就开始上午的刷题了。目前能力也是很菜滴,只做出两个,一个easy,一个medium。还剩两个没下笔。不过自我认为,题不在多,贵在总结,希望自己可以持之以恒。所以就码下自己做的总结,可能方法不是...
But unfortunately, I got "Time Limit Exceeded" result from judging system, it showed that "256/256 cases are passed, but the result is TLE, instead of AC". And I didn't figure out a way to improve my algoritihm until after the contest. ...