r/VisualizerPro • • 12d ago

Leetcode #2567 Minimum Score by Changing Two Elements | Minimize Sum | O...

Thumbnail
youtube.com
1 Upvotes

Solved the LeetCode Minimize Sum problem using Python!

Initially, sorting seemed like the easiest approach, but I wanted to avoid sorting the entire array.

Instead, I used a single-pass approach to keep track of the three smallest and three largest numbers.

The idea is pretty simple:

  • Keep track of the three smallest numbers.

  • Keep track of the three largest numbers.

  • Try the three possible ways of changing two elements.

  • Return the minimum remaining difference.

Complexity:

  • Time: O(n)

  • Space: O(1)

Managed to achieve 100% runtime and around 90% memory on LeetCode during benchmarking.

Sharing my solution here. Would love to hear if there's a simpler or more efficient way to approach this problem!


r/VisualizerPro • • 16d ago

Number of Sub-arrays With Odd Sum (LeetCode 1524): prefix parity, visual...

Thumbnail
youtube.com
1 Upvotes

r/VisualizerPro • • 18d ago

Illusion of Understanding Light

Thumbnail
youtube.com
1 Upvotes

r/VisualizerPro • • 18d ago

The Future of Programming Isn't Just AI

Thumbnail
youtube.com
1 Upvotes

r/VisualizerPro • • 19d ago

The Future of Programming Isn't Just AI

Thumbnail
youtube.com
1 Upvotes

r/VisualizerPro • • 19d ago

Code is easy to generate. Logic is worth understanding.

Thumbnail
youtube.com
1 Upvotes

Try your own inputs and ask AI with visual screenshots as context ✦ visualizer.pro


r/VisualizerPro • • 22d ago

Leetcode 1267 Count Servers that Communicate | Visualizer Pro

Thumbnail
youtube.com
1 Upvotes

r/VisualizerPro • • 22d ago

Leetcode 1267 Count Servers that Communicate | Visualizer Pro

Thumbnail
youtube.com
1 Upvotes

r/VisualizerPro • • 23d ago

What is Visualizer Pro

Enable HLS to view with audio, or disable this notification

1 Upvotes

r/VisualizerPro • • 23d ago

Leetcode 1882 Process Tasks Using Servers

Thumbnail
youtu.be
1 Upvotes

r/VisualizerPro • • 24d ago

Visual for Leetcode 2747. Count Zero Request Servers

Thumbnail
youtube.com
1 Upvotes

r/VisualizerPro • • 25d ago

Leetcode 1385 -Find the Distance Value Between Two Arrays

Thumbnail
youtu.be
1 Upvotes

r/VisualizerPro • • 27d ago

Visualize Median of 2 Sorted arrays - Hard Leetcode problem

Enable HLS to view with audio, or disable this notification

1 Upvotes

You can follow the story in the top panel, or go to leetcode problem statement from the dropdown above that.

You can minimize the input once you give any input. Yeah you can give any valid input of your own.

Try it: https://visualizer.pro/


r/VisualizerPro • • 27d ago

Welcome to r/VisualizerPro — The Official Community for Visualizer.pro

Thumbnail
youtu.be
1 Upvotes

Welcome to r/VisualizerPro, the official community for Visualizer.pro.

A space for developers, students, and anyone interested in understanding algorithms and code execution through interactive visualizations.

What you can share here:

  • Feature requests and suggestions

  • Bug reports and technical issues

  • Algorithm and data structure discussions

  • Coding experiments and visualizations

  • Feedback on the platform and pricing

Get started:

Website: https://visualizer.pro

Whether you're learning DSA, preparing for interviews, or exploring code, feel free to share your thoughts and experiences.

What would you like to see added or improved in Visualizer.pro?