Text Justification | LeetCode | Greedy Approach | Problem Solving | FAANG | Shashwat

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 ก.ย. 2024
  • Java Plus DSA Complete Placement Course:
    • Java and DSA Course Pl...
    Coding Interview Problem Playlist:
    • Problem Solving | Prod...
    Problem Statement:
    Given an array of strings words and a width maxWidth, format the text such that each line has exactly maxWidth characters and is fully (left and right) justified.
    You should pack your words in a greedy approach; that is, pack as many words as you can in each line. Pad extra spaces ' ' when necessary so that each line has exactly maxWidth characters.
    Extra spaces between words should be distributed as evenly as possible. If the number of spaces on a line does not divide evenly between words, the empty slots on the left will be assigned more spaces than the slots on the right.
    For the last line of text, it should be left-justified and no extra space is inserted between words.
    Problem Link:
    leetcode.com/p...
    Solution Snippet:
    github.com/Tiw...
    Company Tags:
    Facebook | Amazon | Microsoft | Netflix | Google | LinkedIn | Pega Systems | VMware | Adobe
    Instagram Handle: (@shashwat_tiwari_st)
    shashwattiwari...
    #ShashwatTiwari #coding​​ #problemsolving​ #leetcode​ #hackerrank​ #hackerearth​ #codechef​ #codesignal​ #algorithms​ #javaprogramming​ #sde​ #placement #programming

ความคิดเห็น • 5

  • @shashwat_tiwari_st
    @shashwat_tiwari_st  ปีที่แล้ว +1

    This is a very old video, for better sound and camera quality DSA videos, learn from the below playlist!
    Java Plus DSA ( Java + DSA + Problem Solving )
    th-cam.com/play/PLQ7ZAf76c0ZPVdhV1bAjFv0bQc1xHURzE.html

  • @arupbaral1605
    @arupbaral1605 3 ปีที่แล้ว +3

    great explanation. but camera ka focus ki baja se thora concentration problem ho rahi thi

  • @eziosan7208
    @eziosan7208 2 ปีที่แล้ว +1

    Its leetcode 68 not 58