>this is a leetcode hard

>this is a leetcode hard
the absolute state of leetshitters

Beware Cat Shirt $21.68

Rise, Grind, Banana Find Shirt $21.68

Beware Cat Shirt $21.68

  1. 3 weeks ago
    Anonymous

    ugh
    no wonder theyre getting fired

    • 3 weeks ago
      Anonymous

      yeah forreal, this is a light medium and takes like 10 minutes to solve and write down

  2. 3 weeks ago
    Anonymous

    You guys don't know what you're talking about. Any idiot could solve this. The challenge is figuring out an algorithm with the lowest possible time complexity and space complexity. This seems like one which requires a graph pathfinding. You're not gonna come up with an optimal solution unless you happen to already know about that.

    • 3 weeks ago
      Anonymous

      >This seems like one which requires a graph pathfinding.
      KEK

    • 3 weeks ago
      Anonymous

      Yeah, I began to do leetcode like a week ago and noticed this about many problems. It's easy to come up with a brute force solution but the toughest test cases are big enough that you need to be using a non naive algorithm to not get a timeout.

    • 3 weeks ago
      Anonymous

      >This seems like one which requires a graph pathfinding.
      Breadth-first search is not impressive.

      • 3 weeks ago
        Anonymous

        There's an A* heuristic which is the number of letters that differ.

        • 3 weeks ago
          Anonymous

          A* requires binary heaps where you can change key priority, and implementing those yourself is never worth the trouble.

          • 3 weeks ago
            Anonymous

            I always import solution.

          • 3 weeks ago
            Anonymous

            import a_star

        • 3 weeks ago
          Anonymous

          Ah, very cool. Wouldn't have thought about it.

  3. 3 weeks ago
    Anonymous

    it's all meaningless human coding is a stranded asset an AI will solve this like it's nothing

    • 3 weeks ago
      Anonymous

      >stranded asset
      You learned that phrase yesterday from a shitpost you dumb homosexual moron

      • 3 weeks ago
        Anonymous

        quiet strandee

        • 3 weeks ago
          Anonymous

          You seem like the kind of subhuman moron that would spam the red deer shit everywhere a couple years back

          • 3 weeks ago
            Anonymous

            do not bore me with boomer lore strandee

  4. 3 weeks ago
    Anonymous

    leetcode hards are totally random in difficulty. some are trivial and others are absolute bullshit

  5. 3 weeks ago
    Anonymous

    Pick literally any other one and come brag about your inefficient solution.
    Not every problem has the correct difficulty rating

    • 3 weeks ago
      Anonymous

      >Not every problem has the correct difficulty rating
      but why? it's not that hard to determine difficulty

  6. 3 weeks ago
    Anonymous

    the difficulty labeling of leetcode problems is inconsistent

  7. 3 weeks ago
    Anonymous

    >Have you read chapter N of my favorite book on algorithms?
    Why is this every leetcode question?
    >Well yesterday I learned about graphs, so I'll make a graph problem
    >Today I learned about shortest path searching algorithms so I'll include a path you have to follow

  8. 3 weeks ago
    Anonymous

    O(n)
    def transformation_sequence(begin, end):
    result = []

    diff = [i for i, c in enumerate(begin) if c not in end]
    w = begin
    for idx in diff:
    result.append(w)
    w = w[:idx] + end[idx] + w[idx+1:]

    return result + [end]

    print(transformation_sequence("hit", "cog"))

    • 3 weeks ago
      Anonymous

      You didn't understand the problem.

      • 3 weeks ago
        Anonymous

        Dear [Candidate's First Name],

        Thank you for your interest in the [Position] role at [Company]. We appreciate the time and effort you invested in applying for this position.

        After careful consideration, we have decided not to move forward with your application at this time. We received a significant number of applications from qualified candidates like yourself, making this selection process extremely difficult.

        lol i actually misread it

        • 3 weeks ago
          Anonymous

          I interpreted it exactly the same way you did at first anon.

    • 3 weeks ago
      Anonymous

      filtered, read the problem moron, where the frick is the wordlist?

      • 3 weeks ago
        Anonymous

        You didn't understand the problem.

        >HECKIN' SPOON-FEED ME!
        sneed

    • 3 weeks ago
      Anonymous

      Dear [Candidate's First Name],

      Thank you for your interest in the [Position] role at [Company]. We appreciate the time and effort you invested in applying for this position.

      After careful consideration, we have decided not to move forward with your application at this time. We received a significant number of applications from qualified candidates like yourself, making this selection process extremely difficult.

    • 3 weeks ago
      Anonymous

      >didn't even understand the question

      here's the solution for brainlets btw

      fun diffOne(a: String, b: String): Boolean {
      var counter = 0
      for (i in a.indices) {
      if (a[i] != b[i]) {
      if (++counter == 2) return false
      }
      }
      return counter == 1
      }

      fun transformationLength(beginWord: String, endWord: String, wordList: List<String>): Int {
      val visited = BooleanArray(wordList.size)
      val queue: Queue<String> = LinkedList()
      queue.offer(beginWord)
      var depth = 1
      while (queue.isNotEmpty()) {
      for (i in queue.indices) {
      val item = queue.poll()
      if (item == endWord) return depth
      for ((index, word) in wordList.withIndex()) {
      if (visited[index]) continue
      if (diffOne(item, word)) {
      queue.offer(word)
      visited[index] = true
      }
      }
      }
      depth++
      }
      return 0
      }

      >timeout tier

      such difficulty

      >stack overflow tier
      Holy shit you're moronic.

      • 3 weeks ago
        Anonymous

        tier
        It's not gonna timeout because it has early return and memorization, brainlet

        • 3 weeks ago
          Anonymous

          It's "memoization", dumbass. And it's not gonna save you from having the wrong time complexity.

          • 3 weeks ago
            Anonymous

            >It's "memoization", dumbass. And it's not gonna save you from having the wrong time complexity.
            Let's see your solution then

  9. 3 weeks ago
    Anonymous

    A brute force solution to this problem seems immediately obvious, but the brute force solution has big O complexity of O(n!) where n is the size of wordList. For larger wordList sizes your program will timeout and the solution will not be accepted.

    • 3 weeks ago
      Anonymous

      the optimal solution has worst case O(n*avg(word.length)) time complexity

  10. 3 weeks ago
    Anonymous

    i am like the anti-coder in terms of coding but even i think this seems to be on the easier side.

  11. 3 weeks ago
    Anonymous

    here's the solution for brainlets btw

    fun diffOne(a: String, b: String): Boolean {
    var counter = 0
    for (i in a.indices) {
    if (a[i] != b[i]) {
    if (++counter == 2) return false
    }
    }
    return counter == 1
    }

    fun transformationLength(beginWord: String, endWord: String, wordList: List<String>): Int {
    val visited = BooleanArray(wordList.size)
    val queue: Queue<String> = LinkedList()
    queue.offer(beginWord)
    var depth = 1
    while (queue.isNotEmpty()) {
    for (i in queue.indices) {
    val item = queue.poll()
    if (item == endWord) return depth
    for ((index, word) in wordList.withIndex()) {
    if (visited[index]) continue
    if (diffOne(item, word)) {
    queue.offer(word)
    visited[index] = true
    }
    }
    }
    depth++
    }
    return 0
    }

    • 3 weeks ago
      Anonymous

      Literally just breadth-first search.

      • 3 weeks ago
        Anonymous

        Yup + memorization and proceed to next level based on condition
        Hilarious that it qualifies as an LC hard

  12. 3 weeks ago
    Anonymous

    ITT: homosexual moron nocoders pretend to know how to answer LC hard with stolen LC answers provided by fricking Sandeep

  13. 3 weeks ago
    Anonymous

    such difficulty

    • 3 weeks ago
      Anonymous

      >Recursion
      Solution invalid, I'm sorrybanon

      • 3 weeks ago
        Anonymous

        it wasn't mentioned in the specification that certain techniques can not be used, nor any space, time, or complexity requirement

        • 3 weeks ago
          Anonymous

          >it wasn't mentioned in the specification that certain techniques can not be used, nor any space, time, or complexity requirement
          It's doesn't matter what the requirements are, dfs is not the optimal solution and your implementation will probably ACK for any word list bigger than 15 kek

        • 3 weeks ago
          Anonymous

          Yes that's something shitty about leetcode. I don't know of any site that does at least some empirical evaluation of your time complexity (gbench can do it).
          But in interviews it always matters, obviously. You're not necessarily given the target, you're supposed to find an optimal solution yourself.

          • 3 weeks ago
            Anonymous

            >But in interviews it always matters
            let me rephrase that
            it only matters in interviews
            for real jobs noone ever judges your code on complexity

            >anon can you estimate how long this module/project will take to code?
            >well, it will take 2 hours to code and then another 6 hours to optimize for O(n log(n)) time complexity and O(n) memory complexity ;^)
            >... yeah just do it in 2 hours, there is more work to be done

          • 3 weeks ago
            Anonymous

            Not true, I could get one of my coworkers fired because of how poorly his code performs.

          • 3 weeks ago
            Anonymous

            >muh personal anecdote

          • 3 weeks ago
            Anonymous

            85 IQ

          • 3 weeks ago
            Anonymous

            >for real jobs noone ever judges your code on complexity
            lol
            Stick to webshit.

  14. 3 weeks ago
    Anonymous

    The example is wrong, hog is a word

    • 3 weeks ago
      Anonymous

      meds

    • 3 weeks ago
      Anonymous

      read the problem again

  15. 3 weeks ago
    Anonymous

    Yes, this task DOES belong to the hard category.
    Were you able to get an AC verdict or are you just bragging that you how fricking high iq you are that you were able to undrstand the problem?
    What is your Codeforces rating?

    • 3 weeks ago
      Anonymous

      >Bragging about knowing bfs
      KEK
      Here, an actual leetcode hard, little babby. Now solving THIS, you can be proud of.
      https://leetcode.com/problems/trapping-rain-water-ii/
      >Given an m x n integer matrix heightMap representing the height of each unit cell in a 2D elevation map, return the volume of water it can trap after raining.

      • 3 weeks ago
        Anonymous

        And this should be hard?
        You literally drop a seed on the highest place from top which is O(n*m) and do a flood fill, and stop when any of the 6 sides except the top and bottom had air (nothing and neighbour) which is easy to model with a boolean matrix. You just add up the correct cube count during flood fill.
        You didn't answer my question, what is your Codeforces rating?

        • 3 weeks ago
          Anonymous

          >flood fill
          Opinion discarded lmfao

          • 3 weeks ago
            Anonymous

            Problem with it? This can be imagined as a grid graph, you cannot discover the holes in less than O(x*y*z) where x,y and z are the dimensions of the map, and my algorithm runs in exactly this time complexity. So you don't do Codeforces, Atcodet, IOI nor ICPC and haven't read CP3. The only thing I don't get then is why are you pretending to be smart on the internet? You've posted 2 problems with the text "too easy for me", while not coding a single line, not having a single idea for an algorithm not even speaking of an AC verdict. Solve this fricking exercise, then solve the next and then a 100 more, be smart in your head, not on the internet.

  16. 3 weeks ago
    Anonymous

    >in college took to algorithms like a fish to water, had zero issues implementing all of them just from high level descriptions
    >now after 5 years in the industry I can barely implement sorting and get confused with even easy leetcodes
    Wtf happened

    • 3 weeks ago
      Anonymous

      Turns out software engineering has a lot more components than "I HAVE THREE METHSTEEKS" Layton-tier brain teasers, so you just forget.

Your email address will not be published. Required fields are marked *