| — | — | — | — |
| 1 | A | f | 2500 |
| 2 | B | m | 1500 |
| 3 | C | f | 5500 |
| 4 | D | m | 500 |
[Answer]
Runtime: 151 ms, faster than 61.29% of MySQL online submissions for Swap Salary.
Memory Usage: N/A
Write your MySQL query statement below
UPDATE salary SET sex = IF(sex = ‘f’, ‘m’, ‘f’)
657. Robot Return to Origin
[Description]
There is a robot starting at position (0, 0), the origin, on a 2D plane. Given a sequence of its moves, judge if this robot ends up at (0, 0) after it completes its moves.
The move sequence is represented by a string, and the character moves[i] represents its ith move. Valid moves are R (right), L (left), U (up), and D (down). If the robot returns to the origin after it finishes all of its moves, return true. Otherwise, return false.
Note: The way that the robot is “facing” is irrelevant. “R” will always make the robot move to the right once, “L” will always make it move left, etc. Also, assume that the magnitude of the robot’s movement is the same for each move.
Example 1:
Input: “UD”
Output: true
Explanation: The robot moves up once, and then down once. All moves have the same magnitude, so it ended up at the origin where it started. Therefore, we return true.
Example 2:
Input: “LL”
Output: false
Explanation: The robot moves left twice. It ends up two “moves” to the left of the origin. We return false because it is not at the origin at the end of its moves.
[Answer]
Runtime: 5 ms, faster than 94.72% of Java online submissions for Robot Return to Origin.
Memory Usage: 36.8 MB, less than 99.80% of Java online submissions for Robot Return to Origin.
class Solution {
public boolean judgeCircle(String moves) {
if (moves == null || moves.trim().length() == 0)
return true;
int x = 0, y = 0;
for (char c : moves.toCharArray()) {
switch © {
case ‘L’:
x–;
break;
case ‘R’:
x++;
break;
case ‘U’:
y++;
break;
case ‘D’:
y–;
break;
}
}
return x == 0 && y == 0;
}
}
665. Non-decreasing Array
Runtime: 1 ms, faster than 99.42% of Java online submissions for Non-decreasing Array.
Memory Usage: 46.6 MB, less than 9.52% of Java online submissions for Non-decreasing Array.
class Solution {
public static boolean checkPossibility(int[] nums) {
for(int i = 0; i < nums.length - 1; i++){
//first occurance
if(nums[i] > nums[i+1]){
for(int j = i + 1; j < nums.length - 1; j++){
//second occurance
if (nums[j] > nums[j+1])
return false;
}
if(i == 0 || i + 2 > nums.length - 1){
return true;
}
if(nums[i] > nums[i + 2]){
if(nums[i - 1] > nums[i + 1]){
return false;
}
}
return true;
}
}
自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。
深知大多数Android工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则几千的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!
因此收集整理了一份《2024年Android移动开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上Android开发知识点,真正体系化!
由于文件比较大,这里只是将部分目录大纲截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且后续会持续更新
如果你觉得这些内容对你有帮助,可以添加V:vip204888 备注Android获取(资料价值较高,非无偿)
最后
希望本文对你有所启发,有任何面试上的建议也欢迎留言分享给大家。
好了,今天的分享就到这里,如果你对在面试中遇到的问题,或者刚毕业及工作几年迷茫不知道该如何准备面试并突破现状提升自己,对于自己的未来还不够了解不知道给如何规划,来看看同行们都是如何突破现状,怎么学习的,来吸收他们的面试以及工作经验完善自己的之后的面试计划及职业规划。
好了~如果你看到了这里,觉得文章写得不错就给个赞呗?如果你觉得那里值得改进的,请给我留言。一定会认真查询,修正不足。谢谢。
为什么某些人会一直比你优秀,是因为他本身就很优秀还一直在持续努力变得更优秀,而你是不是还在满足于现状内心在窃喜!希望读到这的您能点个小赞和关注下我,以后还会更新技术干货,谢谢您的支持!
Nq4bKqX-1711572468348)]
好了~如果你看到了这里,觉得文章写得不错就给个赞呗?如果你觉得那里值得改进的,请给我留言。一定会认真查询,修正不足。谢谢。
[外链图片转存中…(img-Q20k2Cef-1711572468348)]
为什么某些人会一直比你优秀,是因为他本身就很优秀还一直在持续努力变得更优秀,而你是不是还在满足于现状内心在窃喜!希望读到这的您能点个小赞和关注下我,以后还会更新技术干货,谢谢您的支持!