mirror of
https://github.com/krahets/hello-algo.git
synced 2026-08-16 05:30:59 +00:00
Migrate to Zensical (#1869)
* Fix Russian Ruby code extraction. * Add zensical configs.
This commit is contained in:
@@ -4,7 +4,7 @@ Created Time: 2024-05-22
|
||||
Author: Xuan Khoa Tu Nguyen (ngxktuzkai2000@gmail.com)
|
||||
=end
|
||||
|
||||
# ## Алгоритм бэктрекинга: все перестановки II ###
|
||||
### Алгоритм бэктрекинга: все перестановки II ###
|
||||
def backtrack(state, choices, selected, res)
|
||||
# Когда длина состояния равна числу элементов, записать решение
|
||||
if state.length == choices.length
|
||||
@@ -30,7 +30,7 @@ def backtrack(state, choices, selected, res)
|
||||
end
|
||||
end
|
||||
|
||||
# ## Все перестановки II ###
|
||||
### Все перестановки II ###
|
||||
def permutations_ii(nums)
|
||||
res = []
|
||||
backtrack([], nums, Array.new(nums.length, false), res)
|
||||
|
||||
Reference in New Issue
Block a user