[LeetCode]Roman to Integer

ProbleGiven a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.IdeaFinding the Law of Changing Roman Numbers into Arabic Numbers。Solutio[code lang="cpp"class Solution publicint romanToInt(string s) int l = s.length(), a = 0;for (int i = 0; i < l; ++iif (i < l - 1 && char2int(s[i]) < char2int(s[i + 1])) a -= char2int(s[i]);} else a += char2int(s[i]);... Read More

微软工程师:蔡克贺与他的Leetcode刷题之道

YoukYouTub相关资源到底该如何刷LeetCode: https://qoogle.top/how-to-brush-leetcode/ [视频] 如何找实习:https://tinyurl.com/y8fzjzaf[视频] 如何刷题:https://tinyurl.com/yazujcb3[视频] 如何社交:https://tinyurl.com/yavh53qb[视频] 一对一职场资讯:https://tinyurl.com/yb6pfwo视频来源:https://www.youtube.com/watch?v=Z3KrtEaw0v Read More

LeetCode OJ Algorithm – reverse linked list ii (medium)

原题Reverse a linked list from position m to n. Do it in-place and in one-pass.For exampleGiven 1->2->3->4->5->NULL, m = 2 and n = 4return 1->4->3-&gNoteGiven m, n satisfy the following condition1 ≤ m ≤ n ≤ length of list.地址https://leetcode.com/problems/reverse-linked-list-ii程序范例[code lang="cpp"/** Definition for singly-linked list.* struct ListNode * int val;* ListNode *next;* ... Read More