Image by FreePik

1. Problem Statement

  • You may complete at most k transactions.
  • You may not engage in multiple transactions simultaneously (i.e., you must sell the stock before you buy again).
Input: k = 2, prices = [2,4,1]
Output: 2
Explanation: Buy on day 1 (price = 2) and sell on day 2 (price = 4), profit = 4-2 = 2.
Input: k = 2, prices = [3,2,6,5,0,3]
Output…


The Gopher

Exercise 1: Loops and Functions


Image by Freepik

Problem Statement

Examples:

  • Input: [1 ,0 , 2] | Output: 5 { Distribution: [2, 1, 2] }
  • Input: [1, 2, 2] | Output: 4 { Distribution: [2, 1, 1] }
  • Input: [0, 2, 0, 6, 6] | Output: 7 { Distribution:[1, 2, 1, 2, 1] }

Solution 🍬— Time & Space Complexity O(n)


Problem Description

By FreePik


What is a Palindrome?

Even Pal

Even Pals
Even Pals
“Even Pal”
  • character at index2 = character at index3…


  1. AWS Self-Paced Labs:
    💡 Individual Lab: Learn a single AWS Service.
    💡 Quest Labs: Multiple labs to learn related AWS Services.
  2. Play around with 60+ services with the following AWS Free Tier options:
    💡 Free for life.
    💡 Free for 12 months post sign-up date.
    💡 Short-term offer post service-activation date.
  3. Read and follow:
    💡 AWS Documentation
    💡 AWS WhitePapers

NMTechBytes

Anum Sarmad Malik | Software Engineer @ Apple Siri | twitter.com/anumsarmadmalik | dev.to/anumsmalik

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