摘要: 简介 code public class Solution { public int maximumSwap(int num) { String s = String.valueOf(num); int len = s.length(); char[] charArray = s.toCharArr 阅读全文
posted @ 2021-06-14 15:13 HDU李少帅 阅读(32) 评论(0) 推荐(0)
摘要: 简介 sort + map 很简洁 code class Solution { public List<List<String>> groupAnagrams(String[] strs) { Map<String, List<String>> m = new HashMap<>(); for(St 阅读全文
posted @ 2021-06-14 15:03 HDU李少帅 阅读(30) 评论(0) 推荐(0)
摘要: 简介 简化的linux的路径。 其中我看了java的官方代码很简洁, 使用栈来实现 code class Solution { public String simplifyPath(String path) { Stack<String> stack = new Stack(); String[] 阅读全文
posted @ 2021-06-14 14:53 HDU李少帅 阅读(32) 评论(0) 推荐(0)
摘要: 简介 简单, 因为感觉C++ 代码写的比较好, 遂放在博客中. code class Solution { public: ListNode* addTwoNumbers(ListNode* l1, ListNode* l2) { ListNode * r = new ListNode(0); Li 阅读全文
posted @ 2021-06-14 13:39 HDU李少帅 阅读(28) 评论(0) 推荐(0)