Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
题目描述 题解 题解 提交记录 提交记录 [object Object] 该题目是 Plus 会员专享题 感谢使用力扣!您需要升级为 Plus 会员来解锁该题目 升级Plus 会员
publicintdayOfYear(String date){intyear=Integer.parseInt(date.substring(0,4));intmonth=Integer.parseInt(date.substring(5,7));intday=Integer.parseInt(date.substring(8,10));switch(month) {case12: day +=30;case11: day +=31;case10: day +=30;case9: day +=31;case8: day +=31;case7: ...
[LeetCode] 1154. Day of the Year 一年中的第几天 Given a stringdaterepresenting aGregorian calendardate formatted asYYYY-MM-DD, return the day number of the year. Example 1: Input:date="2019-01-09"Output:9Explanation:Givendateisthe9th dayofthe yearin2019. Example 2: Input:date="2019-02...
(xSum==0&∑==0)?"Infinite solutions":(xSum==0?"No solution":"x="+sum/xSum);}publicvoidcalculate(String equation,boolean left){while(true){if(equation==null||equation.equals(""))break;// 防止第一个数是负数,将其当做减号,所以从第一位开始对比int minusIndex=equation.indexOf("-",1)=...
输入:date = "2019-01-09"输出:9解释:给定日期是2019年的第九天。 示例2: 输入:date = "2019-02-10"输出:41 提示: date.length == 10 date[4] == date[7] == '-',其他的date[i]都是数字 date表示的范围从 1900 年 1 月 1 日至 2019 年 12 月 31 日 ...
A collection of Python codes for Leetcode Problem of the Day Topics leetcode leetcode-solutions leetcode-practice leetcode-python leetcode-python3 leetcode-solution leetcode-programming-challenges leetcode-solutions-python problem-of-the-day problem-of-the-day-solutions leetcode-potd Resources Re...
1185. Day of the Week # 题目# Given a date, return the corresponding day of the week for that date. The input is given as three integers representing the day, month and year respectively. Return the answer as one of the following values {"Sunday", "Monday", "Tuesday", "Wednesday", ...
28. 字符串首个匹配下标 Find-the-index-of-the-first-occurrence-in-a-string ★★★ 29. 两数相除 Divide Two Integers ★★ 30. 串联所有单词的子串 Substring-with-concatenation-of-all-words ★★★ Leetcode Golang Day11~20 Golang每日一练(leetDay0011) 31. 下一个排列 Next Permutation ★★ 32...
Given two integer arraysdaysandapplesof lengthn, returnthe maximum number of apples you can eat. Example 1: Input:apples = [1,2,3,5,2], days = [3,2,1,4,2]Output:7Explanation:You can eat 7 apples: - On the first day, you eat an apple that grew on the first day. ...