Kros的博客 Kros的博客
首页
  • CSS
  • 工具
  • Vue
  • js
  • Vue3
  • 算法
  • 折腾笔记
一言
  • 分类
  • 标签
  • 归档
码云

Kros

凡心所向,素履以往,生如逆旅,一苇以航
首页
  • CSS
  • 工具
  • Vue
  • js
  • Vue3
  • 算法
  • 折腾笔记
一言
  • 分类
  • 标签
  • 归档
码云

kros的博客

每一天都是一个新的开始

Find the next perfect square

kros 2025-09-05 随笔每日算法

题目: 找出下一个完全平方数

描述: You might know some pretty large perfect squares. But what about the NEXT one?

Complete the findNextSquare method that finds the next integral perfect square after the one passed as a parameter. Recall that an integral perfect square is an integer n such that sqrt(n) is also an integer.

If the argument is itself not a perfect square then return either -1 or an empty value like None or null, depending on your language. You may assume the argument is non-negative.

Examples ( Input --> Output )

121 --> 144
625 --> 676
114 --> -1  #  because 114 is not a perfect square
1
2
3

在线地址:Find the next perfect square!

阅读全文

Regex validate PIN code

kros 2025-09-05 随笔每日算法

题目: 判断有效的 PIN 字符串

描述: ATM machines allow 4 or 6 digit PIN codes and PIN codes cannot contain anything but exactly 4 digits or exactly 6 digits.

If the function is passed a valid PIN string, return true, else return false.

Examples (Input --> Output)

"1234"   -->  true
"12345"  -->  false
"a234"   -->  false
1
2
3

在线地址:Regex validate PIN code

阅读全文

Find the odd int

kros 2025-09-05 随笔每日算法

题目: 找出数组中出现奇数次数的数字

描述: Given an array of integers, find the one that appears an odd number of times. There will always be only one integer that appears an odd number of times. Examples [7] should return 7, because it occurs 1 time (which is odd). [0] should return 0, because it occurs 1 time (which is odd). [1,1,2] should return 2, because it occurs 1 time (which is odd). [0,1,0,1,0] should return 0, because it occurs 3 times (which is odd). [1,2,2,3,3,3,4,3,3,3,2,2,1] should return 4, because it appears 1 time (which is odd).

在线地址:Find the odd int

阅读全文

具体使用与页面渲染

kros 2025-09-03 项目扫雷

封装扫雷相关类

kros 2025-09-03 项目扫雷

扫雷规则

kros 2025-09-03 项目扫雷

后续优化

kros 2025-09-03 项目扫雷

使用贪吃蛇类

kros 2025-09-02 项目贪吃蛇

封装贪吃蛇类

kros 2025-09-02 项目贪吃蛇

实现思考

kros 2025-09-01 项目贪吃蛇

上一页

1 2 3 30 31

下一页

头像
Kros 凡心所向,素履以往,生如逆旅,一苇以航
文章分类
随笔 85 每日算法 52 项目 18 扫雷 4 贪吃蛇 3 井字棋 3 前端 189 Vue 43 CSS 48 JavaScript 38 更多...
热门标签
vue js CSS uniapp 算法 c# canvas git 阿里云 云效Codeup unity HbuilderX
Theme by Vdoing | Copyright © 2020-2025 kros king
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式
icon-heart-o icon-heart icon-infinity icon-pause icon-play link next prev