牛客347614775号
牛客347614775号
全部文章
分类
题解(18)
归档
标签
去牛客网
登录
/
注册
牛客347614775号的博客
全部文章
(共16篇)
题解 | #字符串的排列#
//substring 用于字符串....charAt(i)用于字符串索引 //n!递归找出口的方法是,递归函数同时传递res。当满足结束条件就push进res function Permutation(str) { // write code here if(str=="")ret...
Javascript Node
2022-01-07
0
421
题解 | #二叉搜索树的最近公共祖先#
* function TreeNode(x) { * this.val = x; * this.left = null; * this.right = null; * } */ //发现找数字大小规律太乱了,那就找结构规律,反正也要按结构索引 function lowestCo...
Javascript Node
2022-01-06
0
456
题解 | #二叉搜索树的后序遍历序列#
//找到true的条件,即找到max界限 //正确的截取子树 //正确判断true出口 function VerifySquenceOfBST(sequence) { // write code here if(sequence.length==0){return false} ...
Javascript Node
2022-01-03
1
378
题解 | #从上往下打印二叉树#
this.val = x; this.left = null; this.right = null; } */ //不明白自己为什么在广度优先卡了十分钟,需要多重复练习! //重构二叉树的题,有时需要new TreeNode function PrintFromTopToBottom...
Javascript Node
2022-01-03
0
394
题解 | #删除链表中重复的结点#
function deleteDuplication(pHead) { // write code here let p=pHead if(!pHead){ return null } let vaild=0 //如果开头遇见重复 ...
Javascript Node
2021-12-31
0
441
题解 | #不相邻最大子序列和#
function subsequence( n , array ) { // write code here let max=0 let res=new Array() for(let i=0;i<array.length;i++){ if(a...
Javascript Node
2021-12-31
0
487
题解 | #主持人调度#
//循环超时。则把问题拆分解决 function minmumNumberOfHost( n , startEnd ) { // write code here let star=[] let end=[] let host=0 for(let i=0;i&...
Javascript Node
2021-12-30
2
478
题解 | #按之字形顺序打印二叉树#
this.val = x; this.left = null; this.right = null; } */ function Print(pRoot) { // write code here let res=[] let d=0 let d1=0...
Javascript Node
2021-12-16
0
433
题解 | #第一个只出现一次的字符#
{ // write code here //ps:删除字符串中所有的某个字符:RegExp模板匹配 //var reg = new RegExp(b);//可以是变量 //var str = str.replace(reg,""); //...
Javascript Node
2021-12-15
0
343
题解 | #最长重复子串#
* 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * @param a string字符串 待计算字符串 * @return int整型 */ function solve( a ) { // write code here let max=...
Javascript Node
2021-12-14
0
375
首页
上一页
1
2
下一页
末页