Skip to content

Latest commit

 

History

History
29 lines (27 loc) · 690 Bytes

张辉-20180720.md

File metadata and controls

29 lines (27 loc) · 690 Bytes

Algorithm

题目: 删除排序数组中的重复项

解答:

# @param {Integer[]} nums
# @return {Integer}
def remove_duplicates(nums, i = 0)
  while nums.size > i
    i += 1 and nums[i] == nums[i-1] and nums.delete_at(i-1) and i-= 1
  end
  print nums
end

Technique

使用grep命令快速搜索代码

  -r 递归查找
  -n 显示行号
  -i 忽略大小写
  -w 匹配整个单词
  
 example:
  # 查找./app/models下的order
  grep -rn order ./app/models

Share

再见微服务 https://segment.com/blog/goodbye-microservices/