From 1f24efa6a814d6dd82fa426ef425ee29f348bc80 Mon Sep 17 00:00:00 2001 From: Vaishnavi Gupta <113535692+Vaishnavi2445@users.noreply.github.com> Date: Sat, 8 Oct 2022 22:12:58 +0530 Subject: [PATCH] Create longest common prefix --- longest common prefix | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 longest common prefix diff --git a/longest common prefix b/longest common prefix new file mode 100644 index 00000000..28f2c2bc --- /dev/null +++ b/longest common prefix @@ -0,0 +1,17 @@ +class Solution { +public: + string longestCommonPrefix(vector& strs) { + string x = ""; + for(int i=0;i