Skip to content
  • Home
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Lux)
  • No Skin
Collapse
Ukraine Tryzub and Canada Leaf
  1. UKRAINIANS ON THE CANADA MAP
  2. Categories
  3. Вільне спілкування
  4. (UA) IT/Tech Ukrainians in Canada

(UA) IT/Tech Ukrainians in Canada

Scheduled Pinned Locked Moved Вільне спілкування
647.4k Posts 3.6k Posters 373.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • t385897444T Offline
    t385897444T Offline
    Max Vedeneev
    wrote on last edited by
    #570637
    позавчора 16 хвилин
    1 Reply Last reply
    0
  • t385897444T Offline
    t385897444T Offline
    Max Vedeneev
    wrote on last edited by
    #570638
    чекнув вчорашню таску - 14 хвилин медіум
    1 Reply Last reply
    0
  • t385897444T Offline
    t385897444T Offline
    Max Vedeneev
    wrote on last edited by
    #570639
    class MyCircularDeque { size: number available: number left: number right: number arr: number[] constructor(k: number) { this.size = k this.available = k this.arr = Array.from({ length: k }, () => 0) this.left = 0 this.right = 0 } fix() { if (this.available === this.size - 1) { this.left = this.right } } insertFront(value: number): boolean { this.log() if (this.available === 0) return false; this.left = this.left + this.size - 1 this.available-- this.arr[this.left % this.size] = value if (this.available === this.size - 1) { this.right = this.left } return true } insertLast(value: number): boolean { this.log() if (this.available === 0) return false; this.right++ this.available-- this.arr[this.right % this.size] = value if (this.available === this.size - 1) { this.left = this.right } return true } deleteFront(): boolean { this.log() if (this.available >= this.size) return false this.left++; this.available++; return true } deleteLast(): boolean { this.log() if (this.available >= this.size) return false this.right--; this.available++; return true } getFront(): number { if (this.isEmpty()) return -1 this.log() return this.arr[this.left % this.size] } log() { // const { size, available, arr, left, right } = this // console.log({ // size, available, arr, left, right // }) } getRear(): number { if (this.isEmpty()) return -1 this.log() return this.arr[this.right % this.size] } isEmpty(): boolean { return this.available === this.size } isFull(): boolean { return this.available === 0 } } /** * Your MyCircularDeque object will be instantiated and called as such: * var obj = new MyCircularDeque(k) * var param_1 = obj.insertFront(value) * var param_2 = obj.insertLast(value) * var param_3 = obj.deleteFront() * var param_4 = obj.deleteLast() * var param_5 = obj.getFront() * var param_6 = obj.getRear() * var param_7 = obj.isEmpty() * var param_8 = obj.isFull() */
    1 Reply Last reply
    0
  • t304000159T Offline
    t304000159T Offline
    Gleb
    wrote on last edited by
    #570640
    rip
    1 Reply Last reply
    0
  • t304000159T Offline
    t304000159T Offline
    Gleb
    wrote on last edited by
    #570641
    чи там js?
    1 Reply Last reply
    0
  • t304000159T Offline
    t304000159T Offline
    Gleb
    wrote on last edited by
    #570642
    покритикувати по фану
    1 Reply Last reply
    0
  • t385897444T Offline
    t385897444T Offline
    Max Vedeneev
    wrote on last edited by
    #570643
    нашо?)
    1 Reply Last reply
    0
  • t304000159T Offline
    t304000159T Offline
    Gleb
    wrote on last edited by
    #570644
    скинь код
    1 Reply Last reply
    0
  • t385897444T Offline
    t385897444T Offline
    Max Vedeneev
    wrote on last edited by
    #570645
    витратив на медіум 24 хвилини
    1 Reply Last reply
    0
  • t385897444T Offline
    t385897444T Offline
    Max Vedeneev
    wrote on last edited by
    #570646
    Трохи заговорився з вами)
    1 Reply Last reply
    0
  • t385897444T Offline
    t385897444T Offline
    Max Vedeneev
    wrote on last edited by
    #570647
    2 c половиной хвилини))))
    1 Reply Last reply
    0
  • t385897444T Offline
    t385897444T Offline
    Max Vedeneev
    wrote on last edited by
    #570648
    leetcode.com/problems/distance-between-bus-stops/description/
    1 Reply Last reply
    0
  • T Offline
    T Offline
    Vadym Serdiuk
    wrote on last edited by
    #570649
    Не треба 😂
    1 Reply Last reply
    0
  • t385897444T Offline
    t385897444T Offline
    Max Vedeneev
    wrote on last edited by
    #570650
    зараз пошукаю щось на дейкстру
    1 Reply Last reply
    0
  • t385897444T Offline
    t385897444T Offline
    Max Vedeneev
    wrote on last edited by
    #570651
    тощо що це алгоритми, а не читабельний код
    1 Reply Last reply
    0
  • T Offline
    T Offline
    Vadym Serdiuk
    wrote on last edited by
    #570652
    Навіщо викликати log декілька разів, якщо там все закоментовано?)
    1 Reply Last reply
    0
  • t385897444T Offline
    t385897444T Offline
    Max Vedeneev
    wrote on last edited by
    #570653
    нічо не робить)
    1 Reply Last reply
    0
  • t385897444T Offline
    t385897444T Offline
    Max Vedeneev
    wrote on last edited by
    #570654
    leetcode.com/problems/sum-of-prefix-scores-of-strings/description/ - хард, 10 хвилин
    1 Reply Last reply
    0
  • T Offline
    T Offline
    Vadym Serdiuk
    wrote on last edited by
    #570655
    Відверто кажучи 2,5 хв для редюса це забагато якось 🤣
    1 Reply Last reply
    0
  • t385897444T Offline
    t385897444T Offline
    Max Vedeneev
    wrote on last edited by
    #570656
    leetcode.com/problems/walking-robot-simulation/description/ - 10 хвилин
    1 Reply Last reply
    0

  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Home
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups