2937. Make Three Strings Equal

  Рет қаралды 55

CodeVia

CodeVia

6 ай бұрын

2937. Make Three Strings Equal #leetcodequestionandanswers #java #coding #microsoftinterview #javainterviewquestions #interview #amazoninterviewpreparation #googleinterview #leetcode #javaprogramming #dsa #dsalgo #programming
leetcode.com/problems/make-th...
You are given three strings s1, s2, and s3. You have to perform the following operation on these three strings as many times as you want.
In one operation you can choose one of these three strings such that its length is at least 2 and delete the rightmost character of it.
Return the minimum number of operations you need to perform to make the three strings equal if there is a way to make them equal, otherwise, return -1.
Example 1:
Input: s1 = "abc", s2 = "abb", s3 = "ab"
Output: 2
Explanation: Performing operations on s1 and s2 once will lead to three equal strings.
It can be shown that there is no way to make them equal with less than two operations.

Пікірлер
The moment we stopped understanding AI [AlexNet]
17:38
Welch Labs
Рет қаралды 796 М.
No empty
00:35
Mamasoboliha
Рет қаралды 3 МЛН
아이스크림으로 체감되는 요즘 물가
00:16
진영민yeongmin
Рет қаралды 63 МЛН
Fast and Furious: New Zealand 🚗
00:29
How Ridiculous
Рет қаралды 22 МЛН
Каха заблудился в горах
00:57
К-Media
Рет қаралды 4,7 МЛН
Reverse Linked List | Leetcode solutions - 206
12:06
Algorithms Made Easy
Рет қаралды 3,5 М.
Top 10 CSS One Liners That Will Blow Your Mind
13:34
developedbyed
Рет қаралды 930 М.
Leetcode | 1768. Merge Strings Alternately | Easy | Java Solution
6:32
No empty
00:35
Mamasoboliha
Рет қаралды 3 МЛН