日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

python mockito arg_that_wqingxiao

發布時間:2025/3/8 python 20 豆豆
生活随笔 收集整理的這篇文章主要介紹了 python mockito arg_that_wqingxiao 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

偶然間在脈脈上看到了一道頭條的算法面試題

按照題目的理解,簡單的寫了一個html網頁

pool開始{{index}}{{index}}

var vm = new Vue({

el: '#vue_det',

data: {

list: [],

i: 0

},

methods: {

details: function () {

return this.site + " - 學的不僅是技術,更是夢想!";

},

change (index) {

// console.log(index)

if (index === 99) {

this.list[0] = !this.list[0]

this.list[98] = !this.list[98]

this.list[99] = !this.list[99]

} else if (index === 0) {

this.list[0] = !this.list[0]

this.list[1] = !this.list[1]

this.list[99] = !this.list[99]

} else {

// console.log('222')

this.list[index] = !this.list[index]

this.list[index - 1] = !this.list[index - 1]

this.list[index + 1] = !this.list[index + 1]

}

// console.log(this.list)

this.list = JSON.parse(JSON.stringify(this.list))

},

SmartChange (index) {

if (this.i === 99) {

return false

}

if (this.list[this.i] === true) {

this.i = this.i + 1

setTimeout(() => {

this.SmartChange()

}, 10);

} else {

this.change(this.i + 1)

setTimeout(() => {

this.SmartChange()

}, 10);

}

// console.log('222222222',this.i)

},

go () {

for (let index = 1; index < 101; index++) {

this.list.push(Math.random() > 0.5 ? true : false)

}

console.log(this.list)

let a = 0, b = 0

this.list.map(val => {

if (val) {

a++

} else {

b++

}

})

console.log(a, b)

}

},

created () {

this.go()

}

})

得到了如下效果圖

得到如題可以進行開關的示例在最后一個燈特殊處理,鏈接第一個燈,形成環

經過測試發現

只要從序號0開始,如果打開則跳過,如果是滅燈,則點擊i+1

得到如下效果

敲黑板

現在得出的部分結論是

只有隨機亮滅燈是一定比例的時候才有可能全部點亮

現在可行的比例為

亮-滅 50-50

亮-滅 51-49

亮-滅 47-53

亮-滅 44-56

亮-滅 42-58

亮-滅 53-47

亮-滅 54-46

而且,還決定于最后一個燈和相鄰燈的亮滅大家有什么好想法,可以留下見解討論下查看原文

總結

以上是生活随笔為你收集整理的python mockito arg_that_wqingxiao的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。