RSSAmplifier

Blog

ETOOBUSY

🚀 minimal blogging for the impatient

github.polettix.itRSS feed ↗10 posts

Latest posts

Getting the `ntSecurityDescriptor` with an LDAP query

TL;DR I found out how to retrieve the ntSecurityDescriptor in Active Directory, via LDAP. Active Directory is a… beast and it’s not always easy to get what’s needed. This took me… some time. One configuration that is supported for an account is the possibility to set a flag for preventing a user to change password. I’m not sure why there’s such a flag; I can only imagine that’s an easy way to lock…

App::Easer release 2.008 is out

TL;DR There’s a new release of App::Easer : 2.008. Long time no see, huh?!? My last post here was almost e-l-e-v-e-n months ago! ¯\_(ツ)_/¯ OK, back to App::Easer . It was a long due release, after fixing many bugs and annoyances that djerius reported. There’s been new designing but in a backwards-compatible way, especially in how sources can be handled in a new way. Check out the new shiny…

PWC239 - Consistent Strings

TL;DR On with TASK #2 from The Weekly Challenge #239 . Enjoy! The challenge You are given an array of strings and allowed string having distinct characters. A string is consistent if all characters in the string appear in the string allowed. Write a script to return the number of consistent strings in the given array. Example 1 Input: @str = ("ad", "bd", "aaab", "baa", "badab") $allowed = "ab"…

PWC239 - Same String

TL;DR Here we are with TASK #1 from The Weekly Challenge #239 . Enjoy! The challenge You are given two arrays of strings. Write a script to find out if the word created by concatenating the array elements is the same. Example 1 Input: @arr1 = ("ab", "c") Output: true Using @arr1, word1 => "ab" . "c" => "abc" Using @arr2, word2 => "a" . "bc" => "abc" Example 2 Input: @arr1 = ("ab", "c") @arr2 =…

PWC238 - Persistence Sort

TL;DR On with TASK #2 from The Weekly Challenge #238 . Enjoy! The challenge You are given an array of positive integers. Write a script to sort the given array in increasing order with respect to the count of steps required to obtain a single-digit number by multiplying its digits recursively for each array element. If any two numbers have the same count of steps, then print the smaller number…

PWC238 - Running Sum

TL;DR Here we are with TASK #1 from The Weekly Challenge #238 . Enjoy! The challenge You are given an array of integers. Write a script to return the running sum of the given array. The running sum can be calculated as sum[i] = num[0] + num[1] + …. + num[i]. Example 1 Input: @int = (1, 2, 3, 4, 5) Output: (1, 3, 6, 10, 15) Example 2 Input: @int = (1, 1, 1, 1, 1) Output: (1, 2, 3, 4, 5) Example 3…

PWC237 - Maximise Greatness

TL;DR On with TASK #2 from The Weekly Challenge #237 . Enjoy! The challenge You are given an array of integers. Write a script to permute the give array such that you get the maximum possible greatness. To determine greatness, nums[i] < perm[i] where 0 <= i < nums.length Example 1 Input: @nums = (1, 3, 5, 2, 1, 3, 1) Output: 4 One possible permutation: (2, 5, 1, 3, 3, 1, 1) which returns 4…

PWC237 - Seize The Day

TL;DR Here we are with TASK #1 from The Weekly Challenge #237 . Enjoy! The challenge Given a year, a month, a weekday of month, and a day of week (1 (Mon) .. 7 (Sun)), print the day. Example 1 Input: Year = 2024, Month = 4, Weekday of month = 3, day of week = 2 Output: 16 The 3rd Tue of Apr 2024 is the 16th Example 2 Input: Year = 2025, Month = 10, Weekday of month = 2, day of week = 4 Output: 9…

PWC236 - Array Loops

TL;DR On with TASK #2 from The Weekly Challenge #236 . Enjoy! The challenge You are given an array of unique integers. Write a script to determine how many loops are in the given array. To determine a loop: Start at an index and take the number at array[index] and then proceed to that index and continue this until you end up at the starting index. Example 1 Input: @ints =…

PWC236 - Exact Change

TL;DR Here we are with TASK #1 from The Weekly Challenge #236 . Enjoy! The challenge You are asked to sell juice each costs $5. You are given an array of bills. You can only sell ONE juice to each customer but make sure you return exact change back. You only have $5, $10 and $20 notes. You do not have any change in hand at first. Write a script to find out if it is possible to sell to each…