Sign in

Opening

Listed as easy, description:

Given the array candies and the integer extraCandies, where candies[i] represents the number of candies that the ith kid has.

For each kid check if there is a way to distribute extraCandiesamong the kids such that he or she can have the greatestnumber of candies among them. Notice that multiple kids can have the greatest number of candies.

Example 1:

Input: candies = [2,3,5,1,3], extraCandies = 3
Output: [true,true,true,false,true]
Explanation:
Kid 1 has 2 candies and if he or she receives all extra candies (3) will have 5 candies --- the greatest number of candies among the…

Opening

Listed as easy, description:

Given an array nums. We define a running sum of an array as runningSum[i] = sum(nums[0]…nums[i]).

Return the running sum of nums.

Example 1:

Input: nums = [1,2,3,4]
Output: [1,3,6,10]
Explanation: Running sum is obtained as follows: [1, 1+2, 1+2+3, 1+2+3+4].

Example 2:

Input: nums = [1,1,1,1,1]
Output: [1,2,3,4,5]
Explanation: Running sum is obtained as follows: [1, 1+1, 1+1+1, 1+1+1+1, 1+1+1+1+1].

Example 3:

Input: nums = [3,1,2,10,1]
Output: [3,4,6,16,17]

Constraints:

  • 1 <= nums.length <= 1000
  • -10^6 <= nums[i] <= 10^6

Solution

If this problem is challenging, it’s the fact that you have to keep track of a…


Entry level positions, hiring practices, and so on and oh my! My take.

Table of Content
Background
Statistics
Numbers
Idealism
Check
Conclusion

Background

How do you write about something on a subject as big as the title might suggest? You might start with a quote: “I have a degree but I can’t find a job.”

Most of the times, new graduates face this struggle. With the contraction of the economy, even the older workforce is affected.

There are too many problems with this industry but this stands out the most. I want to expand on some reasons why it arose, which others have shared their opinions on.

I also suspect that people in other…


I couldn’t think of a funny title so I went with what you see now. “Fun Time With INT 0x80” sounded off. Anyway.. I just wanted to share my experience.

I learned a lot and I want to thank the following for the experience: Robin (Captain), potkettleracism, theorycrafter, jy200, banksy, Jayjay, 0x00, BugCatcherNade, RubberBanned, victorlvg678, soap, minceontoast

I was able to reproduce some of what we did and would do something like this again. This DEFCON was hosted by Threat Sims. The top 20 would go on to the finals and we were ranked 39. Very close.

This year was…


Opening

Easy

Balanced strings are those who have equal quantity of ‘L’ and ‘R’ characters.

Given a balanced string s split it in the maximum amount of balanced strings.

Return the maximum amount of splitted balanced strings.

Example 1:

Input: s = "RLRRLLRLRL"
Output: 4
Explanation: s can be split into "RL", "RRLL", "RL", "RL", each substring contains same number of 'L' and 'R'.

Example 2:

Input: s = "RLLLLRRRLR"
Output: 3
Explanation: s can be split into "RL", "LLLRRR", "LR", each substring contains same number of 'L' and 'R'.

Example 3:

Input: s = "LLLLRRRR"
Output: 1
Explanation: s can be split…

@pry0cc asked in Discord if anybody wanted write up something about remediation. I volunteered with @Cryoplex. The last time I did a CTF was in college so I’m rusty.

The Attack

Anyway, let’s get straight to it. You can find the exercise here. As noted, there are multiple ways to solve this. The first exercise is about web security. It looks like this.

0x00sec Exercise #1

In order to recommend any remediation, you should know how the attack is carried out. So, just looking at this, we need two piece of information.

Cryoplex found that the server was running Nginx 1.17.5 and PHP 7.3.14 according…


Opening

Easy

Given an array arr, replace every element in that array with the greatest element among the elements to its right, and replace the last element with -1.

After doing so, return the array.

Example 1:

Input: arr = [17,18,5,4,6,1]
Output: [18,6,6,6,1,-1]

Constraints:

  • 1 <= arr.length <= 10^4
  • 1 <= arr[i] <= 10^5

Solution

This is a “tough” easy problem because the example isn’t exactly clear and there is only one example. Here are the facts.

We have to replace every element in the array with the greatest element to the right. Then we have to replace the last element with…


Introduction

We all love checklists. Who doesn’t? It’s simple and helps us keep track of where we are. Anyway, this is a really ambitious mini project to try to cover every aspect of our life.

It’s ambitious because there is way too much to write. I will only cover the physical and mental aspect of it. I will leave out spiritual because it’s too open to controversy.

The intention behind this writing is that each item is actionable. Don’t you hate reading those articles that says “do these 5 things” or “avoid that 3 things?”

The worst part is how the…


Opening

Easy

We are given a list nums of integers representing a list compressed with run-length encoding.

Consider each adjacent pair of elements [freq, val] = [nums[2*i], nums[2*i+1]] (with i >= 0). For each such pair, there are freq elements with value val concatenated in a sublist. Concatenate all the sublists from left to right to generate the decompressed list.

Return the decompressed list.

Example 1:

Input: nums = [1,2,3,4]
Output: [2,4,4,4]
Explanation: The first pair [1,2] means we have freq = 1 and val = 2 so we generate the array [2].
The second pair [3,4] means we have freq = 3 and…


Opening

Given a non-negative integer num, return the number of steps to reduce it to zero. If the current number is even, you have to divide it by 2, otherwise, you have to subtract 1 from it.

Example 1:

Input: num = 14
Output: 6
Explanation:
Step 1) 14 is even; divide by 2 and obtain 7.
Step 2) 7 is odd; subtract 1 and obtain 6.
Step 3) 6 is even; divide by 2 and obtain 3.
Step 4) 3 is odd; subtract 1 and obtain 2.
Step 5) 2 is even; divide by 2 and obtain 1. …

Cassy

I write just in case death knocks

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store