Logo Miradil's Blog
  • Home
  • About
  • Skills
  • Experiences
  • Education
  • More
    Projects Publications Recent Posts
  • Posts
  • English
    English Azərbaycanca
  • Dark Theme
    Light Theme Dark Theme System Theme
Logo Inverted Logo
  • Posts
  • Introduction
  • DSA
    • CodeForces
      • 1918-A: Brick Wall
    • ICPC
      • 2023
        • Azerbaijani
          • Classify The Roman Numerals
        • Nordic
          • Karl Coder
    • LeetCode
      • 2: Add Two numbers
      • 58: Length of Last Word
      • 142: Linked List Cycle II
    • Eolymp
      • 87: Robot
      • 325: Dangerous route
      • 4036 & 4038: Pre-Order/Post-Order Traversal of a Tree
      • 6254: Timebomb
    • HackerRank
      • Queen's Attack II
      • Winning Lottery Ticket
      • Balanced Brackets
  • Django
    • How to detect field changes in Django
  • Reinventing the wheel
    • Linux command: `ls`
      • Command, file types and flags
      • Starting with C
      • Getting the list of files and their info
      • Processing flags
      • Sorting and formatting the output
  • Open Source Projects
    • Integrify
  • Misc
    • How did I get into programming?
    • How I got job in two hours
  • Podcast Notes
    • The Diary of A CEO
      • Vinh Giang
Hero Image
No. 1 Communication Expert: This Speaking Mistake Makes People Dislike You!

Video Notes with timestamps What is communication skills 5:30: So, I thought, okay, get really good technically. Spent thousands of hours in my bedroom by myself, in front of the mirror practicing magic. Got nowhere. I was missing ingredient: magicians call it “showmanship”, a fancy word for communication skills. … let’s say, for example, you are 10/10 technically, but you are 3/10 with your communication skills. Do you think people will perceive you 10/10 or 3/10?

Wednesday, March 19, 2025 | 26 minutes Read
Hero Image
Integrify

Available only in Azerbaijani language for now. Feel free to contribute by translating the article!

Sunday, October 13, 2024 | 1 minute Read
Hero Image
Eolymp 6254: Timebomb

Problem statement You and your teammates from the anti-bomb squad of the local police have been called to defuse a bomb found in the only pub in town. Fearing the tragic consequences this might produce, you go to the scene as quickly as possible. After some research, you learn that the bad guys have created a tricky way to allow them to defuse the bomb at will. You find a remote control with a button that you can take to a safe place. You also find that it is possible to connect to the bomb through a wireless connection and retrieve an ASCII representation of a code every 2 seconds. The bomb then gets defused if the button is pressed when the code is a number divisible by 6. But you have to be careful. If you press the button when the ASCII representation of the code is not a number divisible by 6 or has an invalid representation for any digit, the bomb will explode instead.

Monday, March 18, 2024 | 5 minutes Read
Hero Image
Hackerrank: Winning Lottery Ticket

Problem statement The SuperBowl Lottery is about to commence, and there are several lottery tickets being sold, and each ticket is identified with a ticket ID. In one of the many winning scenarios in the Superbowl lottery, a winning pair of tickets is: Concatenation of the two ticket IDs in the pair, in any order, contains each digit from 0 to 9 at least once. For example, if there are 2 distinct tickets with ticket ID 129300455 and 56789, (129300455, 56789) is a winning pair.

Monday, March 11, 2024 | 6 minutes Read
Hero Image
Leetcode 142: Linked List Cycle II

NOTE: The problem 141: “Linked List Cycle” is a subproblem of this problem, so the solution can be slightly modified to solve that too. Problem statement Given the head of a linked list, return the node where the cycle begins. If there is no cycle, return null. There is a cycle in a linked list if there is some node in the list that can be reached again by continuously following the next pointer. Internally, pos is used to denote the index of the node that tail’s next pointer is connected to (0-indexed). It is -1 if there is no cycle. Note that pos is not passed as a parameter.

Monday, March 4, 2024 | 4 minutes Read
Hero Image
Codeforces: Contest 1918, Problem A

Problem statement time limit per test: 1 second memory limit per test: 256 megabytes input: standard input output: standard output A brick is a strip of size 1 × k, placed horizontally or vertically, where k can be an arbitrary number that is at least 2 (k ≥ 2). A brick wall of size n × m is such a way to place several bricks inside a rectangle n × m, that all bricks lie either horizontally or vertically in the cells, do not cross the border of the rectangle, and that each cell of the n × m rectangle belongs to exactly one brick. Here n is the height of the rectangle n × m and m is the width. Note that there can be bricks with different values of k in the same brick wall.

Monday, February 26, 2024 | 3 minutes Read
Hero Image
Hackerrank: Balanced Brackets

Problem statement A bracket is considered to be any one of the following characters: (, ), {, }, [, or ]. Two brackets are considered to be a matched pair if the an opening bracket (i.e., (, [, or {) occurs to the left of a closing bracket (i.e., ), ], or }) of the exact same type. There are three types of matched pairs of brackets: [], {}, and ().

Sunday, February 18, 2024 | 6 minutes Read
Hero Image
Leetcode 58: Length of Last Word

Problem statement Given a string s consisting of words and spaces, return the length of the last word in the string. A word is a maximal substring consisting of non-space characters only. Example 1 Input: s = "Hello World" Output: 5 Explanation: The last word is "World" with length 5. Example 2 Input: s = " fly me to the moon " Output: 4 Explanation: The last word is "moon" with length 4.

Sunday, February 11, 2024 | 3 minutes Read
Hero Image
How to detect field changes in Django

The Problem While working on Django project, we have every now and then needed to know if a specific field of model has changed or not, and act accordingly. Let’s say, you are developing a logistics website, and want to store status changes of packages whenever there is one. So, you would have model structure similar to something like this: from django.contrib.auth import get_user_model from django.db import models UserModel = get_user_model() class Status(models.Model): name = models.CharField(max_length=32, unique=True) class Package(models.Model): user = models.ForeignKey(UserModel, on_delete=models.CASCADE) shipment_cost = models.DecimalField(max_digits=6, decimal_places=2) weight = models.DecimalField(max_digits=5, decimal_places=2) status = models.ForeignKey(Status, on_delete=models.CASCADE) class PackageStatusHistory(models.Model): package = models.ForeignKey(Package, on_delete=models.CASCADE) from_status = models.ForeignKey(Status, on_delete=models.CASCADE, related_name='from_status', null=True) to_status = models.ForeignKey(Status, on_delete=models.CASCADE, related_name='to_status') created_at = models.DateTimeField(auto_now_add=True) Then, one would add post_save signals, and register the status change:

Wednesday, November 8, 2023 | 6 minutes Read
Hero Image
Hackerrank: Queen's Attack II

Problem statement You will be given a square chess board with one queen and a number of obstacles placed on it. Determine how many squares the queen can attack. A queen is standing on an n×nn \times nn×n chessboard. The chess board’s rows are numbered from 111 to nnn, going from bottom to top. Its columns are numbered from 111 to nnn, going from left to right. Each square is referenced by a tuple, (r,c)(r, c)(r,c), describing the row, rrr, and column, ccc, where the square is located.

Thursday, November 2, 2023 | 9 minutes Read
Hero Image
Classify The Roman Numerals

This problem is from ICPC competition that one of my followers participated (and asked for explanation) on October 22, 2023. Problem statement Your task is to determine the number of symmetry axis of the given Roman Numeral. The following table from Wikipedia displays how the Roman Numerals are written: Individual decimal places Thousands Hundreds Tens Units 1 M C X I 2 MM CC XX II 3 MMM CCC XXX III 4 CD XL IV 5 D L V 6 DC LX VI 7 DCC LXX VII 8 DCCC LXXX VIII 9 CM XC IX Note that:

Saturday, October 28, 2023 | 8 minutes Read
Hero Image
How I got offer, interviewed and received a job all in 2 hours

Available only in Azerbaijani language for now. Feel free to contribute by translating the article!

Sunday, October 15, 2023 | 1 minute Read
  • ««
  • «
  • 1
  • 2
  • »
  • »»
Navigation
  • About
  • Skills
  • Experiences
  • Education
  • Projects
  • Publications
  • Recent Posts
Contact me:
  • miradil.zeynalli@gmail.com
  • mmzeynalli
  • Miradil Zeynalli
  • @mmzeynalli
  • Miradil Zeynalli
  • @mmzeynalli

Toha Theme Logo Toha
© 2024 Copyright.
Powered by Hugo Logo