Форум программистов, компьютерный форум, киберфорум
alhaos
Войти
Регистрация
Восстановить пароль
Старый
Рейтинг: 5.00. Голосов: 1.
[golang] 380. Insert Delete GetRandom O(1)
Запись от alhaos размещена 04.02.2025 в 08:55. Обновил(-а) alhaos 04.02.2025 в 08:57
Показов 1316 Комментарии 0
Метки go, problem

Тут требуется реализовать структуру которая обслуживает список уникальных элементов и реализует следующий интерфейс:

Go
1
2
3
4
5
6
7
type RandomizedSet interface {
 // Insert Добавляет элемент к списку уникальных элементов
 // в случае успеха возвращает ИСТИНУ
 // в обратном случае ЛОЖЬ
 Insert(val int) bool
 // Remove Удаляет элемент из списка уникальных элементов
 // в случае успеха возвращает
...
Аватар для alhaos
Размещено в Без категории
alhaos вне форума
Старый
[golang] 274. H-Index
Запись от alhaos размещена 04.02.2025 в 06:24. Обновил(-а) alhaos 04.02.2025 в 06:38
Показов 969 Комментарии 0
Метки go, problem

Дан целочисленный слайс, индексы в нем это индексы статей, а элементы - это количество цитат приходящиеся на опубликованную статью. 

Задача рассчитать индекс Хирша

Go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// [url]https://leetcode.com/studyplan/top-interview-150/[/url]
 
package topInterview
 
import (
    "sort"
)
 
// hIndex
//
// 274. H-Index
//
// Given an array of integers citations where citations[i] is the number of citations a researcher received for their ith paper, return the researcher's h-index.
//
// According to the definition
...
Аватар для alhaos
Размещено в Без категории
alhaos вне форума
Старый
[golang] 45. Jump Game II
Запись от alhaos размещена 04.02.2025 в 05:11. Обновил(-а) alhaos 04.02.2025 в 05:15
Показов 1025 Комментарии 0
Метки go, problem

Дан слайс целочисленных элементов, индекс начального элемента 0, в каждом элементе массива указанно на сколько максимально можно увеличить индекс чтобы достичь следующего элемента.

Задача вернуть минимальное количество шагов за которое можно добраться до крайнего элемента.

Во всех тестовых данных гарантируется наличие данного пути.

Go
1
2
3
4
5
6
7
8
9
// [url]https://leetcode.com/studyplan/top-interview-150/[/url]
 
package topInterview
 
// jump
//
// 45. Jump Game II
//
// You are given a 0-indexed array of integers nums of length
...
Аватар для alhaos
Размещено в Без категории
alhaos вне форума
Старый
[golang] 55. Jump Game
Запись от alhaos размещена 30.01.2025 в 08:41
Показов 1987 Комментарии 0
Метки go, problem

Игра в прыжки, значение каждого элемента означает насколько максимально мы можем увеличить индекс этого элемента чтобы достичь других элементов. Нужно вернуть ИСТИНУ в том случае если мы можем добраться до крайнего элемента слайса и ЛОЖЬ в если нет.

Go
1
2
3
4
5
6
7
8
// [url]https://leetcode.com/studyplan/top-interview-150/[/url]
 
package topInterview
 
// canJump
//
// 55. Jump Game
// You are given an integer array nums. You are initially positioned at the array's first index, and each element in the array represents your maximum jump length at that position.
...
Аватар для alhaos
Размещено в Без категории
alhaos вне форума
Старый
[golang] 122. Best Time to Buy and Sell Stock II
Запись от alhaos размещена 29.01.2025 в 13:28
Показов 2020 Комментарии 0
Метки go, problem

Тут каждый день мы можем продавать или покупать акцию, на руках может быть только одна акция,
продавать и покупать можно в один и тот же день.

Go
1
2
3
4
5
6
7
8
9
10
11
// [url]https://leetcode.com/studyplan/top-interview-150/[/url]
 
package topInterview
 
// maxProfitII
// 
// 122. Best Time to Buy and Sell Stock II
// 
// You are given an integer array prices where prices[i] is the price of a given stock on the ith day.
// 
// On each day, you may decide to buy and/or sell the stock. You can only hold at most one share of the stock at any
...
Аватар для alhaos
Размещено в Без категории
alhaos вне форума
Старый
[Golang] 121. Best Time to Buy and Sell Stock
Запись от alhaos размещена 28.01.2025 в 20:33. Обновил(-а) alhaos 29.01.2025 в 14:30
Показов 2170 Комментарии 0
Метки go, problem

В этой задаче мы получаем слайс целых чисел, которые означают цену акции в разные моменты времени, и должны вернуть максимально возможную прибыль от купли продажи акции.

Go
1
2
3
4
5
6
7
8
9
10
// [url]https://leetcode.com/studyplan/top-interview-150/[/url]
 
package topInterview
 
// maxProfit
//
// 121. Best Time to Buy and Sell Stock
// You are given an array prices where prices[i] is the price of a given stock on the ith day.
//
// You want to maximize your profit by choosing a single day to buy one stock and choosing a different day in the future to sell that
...
Аватар для alhaos
Размещено в Без категории
alhaos вне форума
Старый
[golang] 189. Rotate Array
Запись от alhaos размещена 28.01.2025 в 14:31. Обновил(-а) alhaos 28.01.2025 в 14:52
Показов 2148 Комментарии 0
Метки go

Повороты рукоятки, целочисленный слайс нужно сдвинуть на целое положительное число. Мне очень нравится решение на GO

Go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// [url]https://leetcode.com/studyplan/top-interview-150/[/url]
 
package topInterview
 
// rotate
//
// 189. Rotate Array
//
// Given an integer array nums, rotate the array to the right by k steps, where k is non-negative.
//
// Example 1:
//
// Input: nums = [1,2,3,4,5,6,7], k = 3
// Output: [5,6,7,1,2,3,4]
// Explanation:
// rotate 1 steps to the right: [7,1,2,3,4,5,6]
// rotate 2
...
Аватар для alhaos
Размещено в Без категории
alhaos вне форума
Старый
[golang] 169. Majority Element
Запись от alhaos размещена 28.01.2025 в 08:05
Показов 1917 Комментарии 0
Метки go, problem

Тут надо вернуть "мажористый" элемент который встречается в слайсе больше чем в половине случаев. По условиям задачи во входных данных такой элемент обязан присутствовать.

Go
1
2
3
4
5
6
7
8
9
10
// [url]https://leetcode.com/studyplan/top-interview-150/[/url]
 
package topInterview
 
// majorityElement
//
// 169. Majority Element
// Given an array nums of size n, return the majority element.
//
// The majority element is the element that appears more than ⌊n / 2⌋ times. You may assume that the majority element always exists in the array.
...
Аватар для alhaos
Размещено в Без категории
alhaos вне форума
Старый
Рейтинг: 5.00. Голосов: 1.
[golang] 80. Remove Duplicates from Sorted Array II
Запись от alhaos размещена 28.01.2025 в 06:18
Показов 1817 Комментарии 0
Метки go

В предоставленном упорядоченном по возрастанию целочисленном слайсе, оставить уникальные элементы полюс один возможный дубликат. Вернуть количество таких элементов.

Go
1
2
3
4
5
6
7
8
9
10
// [url]https://leetcode.com/studyplan/top-interview-150/[/url]
 
package topInterview
 
// removeDuplicates
//
// 80. Remove Duplicates from Sorted Array II
// Given an integer array nums sorted in non-decreasing order, remove some duplicates in-place such that each unique element appears at most twice. The relative order of the elements should be kept the same.
//
//
...
Аватар для alhaos
Размещено в Без категории
alhaos вне форума
Старый
Рейтинг: 5.00. Голосов: 1.
[golang] 26. Remove Duplicates from Sorted Array
Запись от alhaos размещена 27.01.2025 в 17:10
Показов 2459 Комментарии 0
Метки go

Необходимо удалить дубликаты из предоставленного целочисленного отсортированного по взрастанию слайса, нужно изменить значения в слайсе и вернуть количество элементов.

Go
1
2
3
4
5
6
7
8
// [url]https://leetcode.com/studyplan/top-interview-150/[/url]
 
package topInterview
 
// removeDuplicates
//
// 26. Remove Duplicates from Sorted Array
// Given an integer array nums sorted in non-decreasing order, remove the duplicates in-place such that each unique element appears only once. The relative order of the elements should be kept the same. Then return the
...
Аватар для alhaos
Размещено в Без категории
alhaos вне форума
Старый
Рейтинг: 5.00. Голосов: 1.
[golang] 27. Remove Element
Запись от alhaos размещена 27.01.2025 в 13:57. Обновил(-а) alhaos 27.01.2025 в 14:06
Показов 2232 Комментарии 0
Метки go

Go
1
2
3
4
5
6
7
8
9
10
11
// [url]https://leetcode.com/studyplan/top-interview-150/[/url]
 
package topInterview
 
// removeElement
// 27. Remove element
// Given an integer array nums and an integer val, remove all occurrences of val in nums in-place. The order of the elements may be changed. Then return the number of elements in nums which are not equal to val.
//
// Consider the number of elements in nums which are not equal to val be k, to get accepted, you need to do the following things:
//
// Change the array nums such that the first k elements of nums contain
...
Аватар для alhaos
Размещено в Без категории
alhaos вне форума
Старый
Рейтинг: 5.00. Голосов: 1.
[golang] 88. Merge Sorted Array
Запись от alhaos размещена 27.01.2025 в 11:29. Обновил(-а) alhaos 27.01.2025 в 14:07
Показов 2213 Комментарии 0
Метки go, problem

Go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
package topInterview
 
// [url]https://leetcode.com/studyplan/top-interview-150/[/url]
 
// merge problem
//
// 88. Merge Sorted Array
//
// You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n,
// representing the number of elements in nums1 and nums2 respectively.
//
// Merge nums1 and nums2 into a single array sorted in non-decreasing order.
// The final sorted array should not be returned by the function, but instead be stored inside the array nums1. To
// accommodate
...
Аватар для alhaos
Размещено в Без категории
alhaos вне форума
Старый
Получить диапазон IP адресов
Запись от alhaos размещена 23.11.2023 в 15:44
Показов 1048 Комментарии 1
Метки powershell

PowerShell
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
function Get-IPRange {
    param (
        [string]$StartIP,
        [string]$EndIP
    )
 
    ((StringIPToIntIP $StartIP)..(StringIPToIntIP $EndIP)).Foreach{
        IntIPToStringIP $_
    }
}
 
function StringIPToIntIP {
    param (
        [string]$IPString
    )
 
    $numbers = $IPString.Split(".") | ForEach-Object {[int]$_}
 
    [array]::Reverse($numbers)
 
    $sum = 0
    (0..3).ForEach{
        $sum += $numbers[$_] * [math]::Pow(256,
...
Аватар для alhaos
Размещено в Без категории
alhaos вне форума
Старый
[golang] Определить является ли число квадратом
Запись от alhaos размещена 22.09.2023 в 09:53
Показов 1267 Комментарии 10
Метки go

Go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package main
 
import "fmt"
 
func main() {
    n := 625
    fmt.Println(n, "is square:", isSquare(n))
}
 
func isSquare(number int) bool {
    if number < 1 {
        return false
    }
    var sum int
    for i := 0; sum < number; i++ {
        sum += i<<1 + 1
        if sum == number {
            return true
        }
    }
    return false
}
Аватар для alhaos
Размещено в Без категории
alhaos вне форума
Старый
[Golang] Генерация положений куба в коробке
Запись от alhaos размещена 26.06.2023 в 20:43
Показов 937 Комментарии 1
Метки go

Куб с различимыми неповторяющимися гранями плотно укладывается в коробку, перечислите все положения какими его туда можно запёхнуть.

я так думаю каждая, сторона шапкой, плюс три вращения, получается шесть положений шапок умножить на четыре положения вращения вокруг шапки, 24 положения, я х3 как это решать, буду тупо вращать куб,

Нотация из кубика рубика

Go
1
2
3
4
5
6
7
8
9
10
11
12
package cube
 
import "fmt"
 
type Side struct {
    Value int
}
 
type Cube struct {
    Front  Side
    Bottom Side
    Left
...
Аватар для alhaos
Размещено в Без категории
alhaos вне форума
Старый
[Golang] Алгоритм Нарайаны
Запись от alhaos размещена 26.06.2023 в 15:28
Показов 880 Комментарии 0
Метки go

Go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package narayana
 
func Next(sl []int) bool {
 
    var (
        n1      int
        n2      int
        n1Found bool
    )
 
    for i := len(sl) - 2; i >= 0; i-- {
        if sl[i] < sl[i+1] {
            n1 = i
            n1Found = true
            break
        }
    }
 
    if !n1Found {
        return false
    }
 
    for i := len(sl) - 1; i > 0; i-- {
        if sl[i] > sl[n1] {
            n2 = i
            break
        }
    }
 
    sl[n1], sl[n2] = sl[n2], sl[n1]
 
    reverseSlice(sl[n1+1:])
...
Аватар для alhaos
Размещено в Без категории
alhaos вне форума
Старый
[Golang] Bubble sort
Запись от alhaos размещена 25.06.2023 в 15:35
Показов 788 Комментарии 0
Метки go

Go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package main
 
import (
    "fmt"
    "math/rand"
    "time"
)
 
func main() {
    c, r := 10, 100
    arr := ArrayOfRandomInt(c, r)
    fmt.Println(arr)
    fmt.Println(BubbleSort(arr))
 
}
 
func BubbleSort(arr []int) []int {
    var iCount int
    for l, found := len(arr)-1, false; l > 1; l-- {
        found = false
        for i := 0; i < l; i++ {
            iCount++
            if arr[i] > arr[i+1] {
                arr[i], arr[i+1] = arr[i+1], arr[i]
...
Аватар для alhaos
Размещено в Без категории
alhaos вне форума
Старый
[Golang] Вернуть массив цифр int
Запись от alhaos размещена 22.06.2023 в 20:07
Показов 739 Комментарии 0
Метки go

Go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package main
 
import "fmt"
 
func main() {
    fmt.Println(DigitsArray(139))
}
 
func DigitsArray(n int) (res []int) {
    for n > 0 {
        res = append([]int{n % 10}, res...)
        n /= 10
    }
    return
}
[1 3 9]
Аватар для alhaos
Размещено в Без категории
alhaos вне форума
Старый
Рейтинг: 4.00. Голосов: 1.
Напечатать ряд чисел квадратной матрицей в случайном порядке
Запись от alhaos размещена 18.04.2023 в 15:17. Обновил(-а) alhaos 18.04.2023 в 15:18
Показов 1115 Комментарии 1
Метки powershell

PowerShell
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$limit = 100
$Series = (1..$limit) | Get-Random -Count $limit
 
function print {
    param (
        [int[]]$Series
    )
 
    $sqrt = [int][System.Math]::Ceiling([System.Math]::Sqrt($Series.Count))
    $paddingN = [int][System.Math]::Floor([System.Math]::Log10($Series.Count)) + 1
 
    for ($i = 0; $i -lt $Series.Count; $i++) {
        Write-Host (($pattern = switch (($i+1) % $sqrt) {
            0 { ", {0,$paddingN}`r`n"}
            1 { "{0,$paddingN}"}
            default
...
Аватар для alhaos
Размещено в Без категории
alhaos вне форума
Старый
Рейтинг: 5.00. Голосов: 2.
Задача: Медальный зачёт
Запись от alhaos размещена 10.11.2021 в 10:10
Показов 2193 Комментарии 6
Метки powershell

С 1988 года распространение получил медальный зачёт, при котором места команд сначала распределяются по количеству золотых медалей, затем места команд с равным количеством золотых медалей выстраиваются по количеству серебряных медалей. При равном количестве золотых и серебряных медалей места команд выстраиваются по количеству бронзовых медалей. Это соответствует тому, что звание чемпиона Олимпийских игр даётся на все времена и звания экс-чемпиона Олимпийских игр не существует.

PowerShell
1
2
3
4
using namespace System.Linq
$inputText = @"
22 21 22 Great Britain
27 14 17 Japan
...
Аватар для alhaos
Размещено в Без категории
alhaos вне форума
Старый
Рейтинг: 1.00. Голосов: 1.
Задача: Simple Pig Latin (Простая поросячья латынь)
Запись от alhaos размещена 09.08.2021 в 13:10
Показов 2928 Комментарии 1
Метки powershell

(c) https://www.codewars.com/kata/... 041100000f

Move the first letter of each word to the end of it, then add "ay"
to the end of the word. Leave punctuation marks untouched.

Examples

Код
Kata.PigIt("Pig latin is cool"); // igPay atinlay siay oolcay
Kata.PigIt("Hello world !");     // elloHay orldway !
Тут речь идет о ранее мне неизвестном термине Поросячья латынь

Нужно переделать слова по следующему правилу:

Требуется...
Аватар для alhaos
Размещено в Без категории
alhaos вне форума
Старый
Рейтинг: 1.00. Голосов: 1.
Задача: Count characters in your string
Запись от alhaos размещена 06.08.2021 в 06:50. Обновил(-а) alhaos 06.08.2021 в 06:52
Показов 3133 Комментарии 1
Метки powershell

(c) https://www.codewars.com/kata/... 61d4000091

The main idea is to count all the occurring characters in a string.
If you have a string like aba, then the result should be {'a': 2, 'b': 1}.

What if the string is empty? Then the result should be empty object literal, {}.

PowerShell
1
2
3
4
5
6
7
using namespace System.Linq
 
class kata{
    static [object] CountCharactersInYourString ([string]$inputString){
        [hashtable]$result = @{}
        [char[]] $chars = $inputString.ToCharArray()
        [Enumerable]::GroupBy($chars,
...
Аватар для alhaos
Размещено в Без категории
alhaos вне форума
Старый
Рейтинг: 1.00. Голосов: 1.
Задача: Persistent Bugger
Запись от alhaos размещена 02.08.2021 в 13:09. Обновил(-а) alhaos 02.08.2021 в 13:12
Показов 2096 Комментарии 1
Метки powershell

(с) https://www.codewars.com/kata/... d57e0000ec
Write a function, persistence, that takes in a positive parameter num and returns its multiplicative persistence, which is the number of times you must multiply the digits in num until you reach a single digit.

For example:

persistence(39) == 3 // because 3*9 = 27, 2*7 = 14, 1*4=4
// and 4 has only one digit

persistence(999) == 4 // because 9*9*9 = 729, 7*2*9 = 126,
// 1*2*6 = 12, and finally 1*2 = 2
...
Аватар для alhaos
Размещено в Без категории
alhaos вне форума
Старый
Рейтинг: 1.00. Голосов: 1.
Задача: Human Readable Time
Запись от alhaos размещена 02.08.2021 в 08:53. Обновил(-а) alhaos 02.08.2021 в 09:11
Показов 1891 Комментарии 1
Метки powershell

(с) https://www.codewars.com/kata/... 774f0001f7

Write a function, which takes a non-negative integer (seconds) as input and returns the time
in a human-readable format (HH:MM:SS)

HH = hours, padded to 2 digits, range: 00 - 99
MM = minutes, padded to 2 digits, range: 00 - 59
SS = seconds, padded to 2 digits, range: 00 - 59
The maximum time never exceeds 359999 (99:59:59)

PowerShell
1
2
3
class kata{
    static [string] HumanReadableTime ([int]$seconds){
        $timespan = [timespan]::FromSeconds($seconds)
...
Аватар для alhaos
Размещено в Без категории
alhaos вне форума
Старый
Рейтинг: 1.00. Голосов: 1.
Задача: Growth of a Population
Запись от alhaos размещена 01.08.2021 в 12:27. Обновил(-а) alhaos 01.08.2021 в 13:07
Показов 3125 Комментарии 2
Метки powershell

(с) https://www.codewars.com/kata/... b5120000c6

In a small town the population is p0 = 1000 at the beginning of a year. The population regularly increases by 2 percent per year and moreover 50 new inhabitants per year come to live in the town. How many years does the town need to see its population greater or equal to p = 1200 inhabitants?

At the end of the first year there will be:
1000 + 1000 * 0.02 + 50 => 1070 inhabitants

At the end of the 2nd year there will be:
1070 + 1070 * 0.02 + 50 => 1141 inhabitants (** number...
Аватар для alhaos
Размещено в Без категории
alhaos вне форума
Старый
Рейтинг: 1.00. Голосов: 1.
Задача: Playing with digits
Запись от alhaos размещена 01.08.2021 в 10:02. Обновил(-а) alhaos 01.08.2021 в 11:47
Показов 2136 Комментарии 1
Метки powershell

(c) https://www.codewars.com/kata/... 78b1000050

Some numbers have funny properties. For example:

Код
89 --> 8¹ + 9² = 89 * 1

695 --> 6² + 9³ + 5⁴= 1390 = 695 * 2

46288 --> 4³ + 6⁴+ 2⁵ + 8⁶ + 8⁷ = 2360688 = 46288 * 51
Given a positive integer n written as abcd... (a, b, c, d... being digits) and a positive integer p

we want to find a positive integer k, if it exists, such as the sum of the digits of n taken to the successive powers of p is equal to k * n.
In other words:

...
Аватар для alhaos
Размещено в Без категории
alhaos вне форума
Старый
Рейтинг: 1.00. Голосов: 1.
Задача: Square Every Digit
Запись от alhaos размещена 31.07.2021 в 18:00
Показов 2081 Комментарии 1
Метки powershell

(c) https://www.codewars.com/kata/... a88e000020

Welcome. In this kata, you are asked to square every digit of a number and concatenate them.
For example, if we run 9119 through the function, 811181 will come out, because 92 is 81 and 12 is 1.
Note: The function accepts an integer and returns an integer

PowerShell
1
2
3
.{
    [int]::Parse(-join $args[0].ToString().ToCharArray().ForEach{[math]::Pow([int]::Parse($_),2).ToString()})
}  9119
Код
811181
Аватар для alhaos
Размещено в Без категории
alhaos вне форума
Старый
Рейтинг: 1.00. Голосов: 1.
Задача: Split Strings
Запись от alhaos размещена 30.07.2021 в 13:44
Показов 2542 Комментарии 1
Метки powershell

(c) https://www.codewars.com/kata/... 8eb6000001

Complete the solution so that it splits the string into pairs of two characters.
If the string contains an odd number of characters then it should replace the
missing second character of the final pair with an underscore ('_').

PowerShell
1
2
3
4
5
6
. {
    $Enumerator = $Args[0].GetEnumerator()
    while ($Enumerator.MoveNext()) {
        $firstLetter = $Enumerator.Current
        $secondLetter = $Enumerator.MoveNext() ? $Enumerator.Current : "_"
        -join ($firstLetter,
...
Аватар для alhaos
Размещено в Без категории
alhaos вне форума
Старый
Рейтинг: 1.00. Голосов: 1.
Конвейер ...
Запись от alhaos размещена 26.05.2021 в 07:42. Обновил(-а) alhaos 26.05.2021 в 07:44
Показов 1969 Комментарии 0
Метки powershell

PowerShell
1
2
3
4
5
6
7
8
9
10
11
12
13
14
using namespace System.Diagnostics
 
class foo {
    static $conf = @{
        scriptBlocks = [scriptblock[]]@(
            {0..999999 | Where-Object {-not [bool]($_ % 3)} | Measure-Object | ForEach-Object Count},
            {((0..999999).Where{-not [bool]($_ % 3)}).count}
            {((0..999999).Where{$_ % 3 -eq 0}).count}
            {for (($i=0), ($bill=0); $i -le 999999;$i++){if ($i % 3 -eq 0){$bill++}}$bill}
        )
    }
    
    static Measure_ScriptBlock () {
        $stopWatch = [Stopwatch]::new()
...
Аватар для alhaos
Размещено в just code
alhaos вне форума
Старый
Рейтинг: 1.00. Голосов: 1.
Задача: Дан массив строк, сгенерировать все возможные уникальные варианты выбора элементов данного массива
Запись от alhaos размещена 24.05.2021 в 08:31
Показов 1885 Комментарии 0
Метки powershell

PowerShell
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
. {
    <#
    .SYNOPSIS
        Дан массив строк, сгенерировать все возможные уникальные варианты выбора элементов данного массива
    #>
 
    param(
        [string[]]$array
    )
 
    ([Linq.Enumerable]::Distinct(
            [string[]]($array.ForEach{
                    $l0 = $_
                    $array.ForEach{
                        $l1 = $_
                        $array.ForEach{
...
Аватар для alhaos
Размещено в Без категории
alhaos вне форума
Новые блоги и статьи
Ошибка "Cleartext HTTP traffic not permitted" в Android
hw_wired 13.02.2025
При разработке Android-приложений можно столнуться с неприятной ошибкой "Cleartext HTTP traffic not permitted", которая может серьезно затруднить отладку и тестирование. Эта проблема особенно. . .
Изменение версии по умолчанию в NVM
hw_wired 13.02.2025
Node Version Manager, или коротко NVM - незаменимый инструмент для разработчиков, использующих Node. js. Многие сталкивались с ситуацией, когда разные проекты требуют различных версий Node. js,. . .
Переименование коммита в Git (локального и удаленного)
hw_wired 13.02.2025
Git как система контроля версий предоставляет разработчикам множество средств для управления этой историей, и одним из таких важных средств является возможность изменения сообщений коммитов. Но зачем. . .
Отличия Promise и Observable в Angular
hw_wired 13.02.2025
В веб-разработки асинхронные операции стали неотъемлимой частью почти каждого приложения. Ведь согласитесь, было бы странно, если бы при каждом запросе к серверу или при обработке больших объемов. . .
Сравнение NPM, Gulp, Webpack, Bower, Grunt и Browserify
hw_wired 13.02.2025
В современной веб-разработке существует множество средств сборки и управления зависимостями проектов, каждое из которых решает определенные задачи и имеет свои особенности. Когда я начинаю новый. . .
Отличия AddTransient, AddScoped и AddSingleton в ASP.Net Core DI
hw_wired 13.02.2025
В современной разработке веб-приложений на платформе ASP. NET Core правильное управление зависимостями играет ключевую роль в создании надежного и производительного кода. Фреймворк предоставляет три. . .
Отличия между venv, pyenv, pyvenv, virtualenv, pipenv, conda, virtualenvwrapp­­er, poetry и другими в Python
hw_wired 13.02.2025
В Python существует множество средств для управления зависимостями и виртуальными окружениями, что порой вызывает замешательство даже у опытных разработчиков. Каждый инструмент создавался для решения. . .
Навигация с помощью React Router
hw_wired 13.02.2025
React Router - это наиболее распространенное средство для создания навигации в React-приложениях, без которого сложно представить современную веб-разработку. Когда мы разрабатываем сложное. . .
Ошибка "error:0308010C­­:dig­ital envelope routines::unsup­­ported"
hw_wired 13.02.2025
Если вы сталкиваетесь с ошибкой "error:0308010C:digital envelope routines::unsupported" при разработке Node. js приложений, то наверняка уже успели поломать голову над её решением. Эта коварная ошибка. . .
Подключение к контейнеру Docker и работа с его содержимым
hw_wired 13.02.2025
В мире современной разработки контейнеры Docker изменили подход к созданию, развертыванию и масштабированию приложений. Эта технология позволяет упаковать приложение со всеми его зависимостями в. . .
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2025, CyberForum.ru