Arts挑战
文章平均质量分 78
张卖命
10年后我要做中国最牛逼的架构师
展开
-
Arts挑战第一周(2022.03.21~2022.03.27)
Algorithm 给你一个字符串 s,找到 s 中最长的回文子串。 class Solution { public String longestPalindrome(String s) { if (s.length() == 1) { return s; } String result = ""; for (int i = 0; i < s.length(); i++) { if原创 2022-04-11 07:21:16 · 114 阅读 · 0 评论 -
Arts挑战第三周(2022.04.04~2022.04.10)
Algorithm 7. 整数反转 - 力扣(LeetCode) (leetcode-cn.com) class Solution { public int reverse(int x) { boolean flag = true; if (x < 0) { flag = false; } x = Math.abs(x); int length = String.原创 2022-04-09 12:35:57 · 868 阅读 · 0 评论 -
Arts挑战第二周(2022.03.28~2022.04.03)
Algorithm 将一个给定字符串 s 根据给定的行数 numRows ,以从上往下、从左到右进行 Z 字形排列。 比如输入字符串为 “PAYPALISHIRING” 行数为 3 时,排列如下: P A H N A P L S I I G Y I R 之后,你的输出需要从左往右逐行读取,产生出一个新的字符串,比如:“PAHNAPLSIIGYIR”。 public String convert(String s, int numRows) {原创 2022-04-03 18:21:08 · 310 阅读 · 0 评论