[抄题]: We are given an array asteroids of integers representing asteroids in a row. For each asteroid, the absolute value represents its size, and the sign represents its direction (positive meaning right, negative meaning left). Each asteroid moves a…
作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 栈 日期 题目地址:https://leetcode.com/problems/asteroid-collision/description/ 题目描述 We are given an array asteroids of integers representing asteroids in a row. For each asteroid, the…
We are given an array asteroids of integers representing asteroids in a row. For each asteroid, the absolute value represents its size, and the sign represents its direction (positive meaning right, negative meaning left). Each asteroid moves at the…
行星碰撞. 题意是给一个数组 asteroids,表示在同一行的行星.对于数组中的每一个元素,其绝对值表示行星的大小,正负表示行星的移动方向(正表示向右移动,负表示向左移动).每一颗行星以相同的速度移动.找出碰撞后剩下的所有行星. 碰撞规则:两个行星相互碰撞,较小的行星会爆炸.如果两颗行星大小相同,则两颗行星都会爆炸.两颗移动方向相同的行星,永远不会发生碰撞.例子, Example 1: Input: asteroids = [5, 10, -5] Output: [5, 10] Explana…
We are given an array asteroids of integers representing asteroids in a row. For each asteroid, the absolute value represents its size, and the sign represents its direction (positive meaning right, negative meaning left). Each asteroid moves at the…
开发中有时候会需要最出弹框后,过几秒自动消失的效果,下面给大家分享一下我自己做的一个小案例. 案例中的弹框使用的是bootstrap里面的模态框,实现自动消失则用的是js中的setInterval方法.该弹框使用了jquery-ui中的draggable方法,可拖动. 目录结构如下: 下面是案例代码: demo.html <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <ti…
hadoop的 namenode又一次格式化以后.重新启动hbase.发现它的hmaster进程启动后立即消失,查看一大堆日志,最后在zookeeper的日志里发现例如以下问题 Unable to read additional data from client sessionid 0x14e86607c850007, likely client has closed socket 解决 方法:删除掉hbase的hdfs-site.xml中一下内容所配置路径下的文件夹.重新启动zookeeper…
  <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title></title> <style> *{ margin:0; padding:0; box-sizing: border-box; } </style> </head> <body> <div clas…
Axure实现提示文本单击显示后自动消失的效果 方法/步骤     如图所示,框出的部分为提示文本(已经命名为tooltip),希望达到的效果是默认加载时不显示,点击帮助图标后显示,且2秒后自动消失.   首先在“属性面板”的交互中,选择“载入时”   在“载入时”用例编辑中,隐藏tooltip,上面的事件无需理会,是另外一个交互事件   再选择要单击的元件,事件选择“鼠标单击时”   先给tooltip增加第一个事件,逐渐显示.   通过“其他”-“等待”,修改等待时间,实现显示2s的效果.…
最近用到bootstrap的告警框时发现只有html的说明,就自己写了一个弹出告警框和弹出短暂显示后上浮消失的告警框. 直接上JS代码了,可以copy过去直接用(使用bootstrap的UI框架的情况下) var commonUtil = { /** * 弹出消息框 * @param msg 消息内容 * @param type 消息框类型(参考bootstrap的alert) */ alert: function(msg, type){ if(typeof(type) =="undefined…