Skip to content

Instantly share code, notes, and snippets.

View raihankhan's full-sized avatar
☸️
Exploring kubernetes

Raihan Khan raihankhan

☸️
Exploring kubernetes
View GitHub Profile
@raihankhan
raihankhan / Delete Operation for Two Strings.cpp
Last active June 14, 2022 15:42
Leetcode daily solutions
// Leetcode daily challenge - 14.06.22
// https://leetcode.com/problems/delete-operation-for-two-strings
// Top Down DP approach - O(n*m) space and O(n^2) time complexity
class Solution {
public:
int minDistance(string word1, string word2) {
int n = word1.size(),m = word2.size();
int dp[n+1][m+1];