From ea315b67aa539e309c61a259e559d0b8fde7ee67 Mon Sep 17 00:00:00 2001 From: anshu231999 Date: Thu, 15 Oct 2020 14:32:03 +0530 Subject: [PATCH] Update WordLadder.swift --- BFS/WordLadder.swift | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/BFS/WordLadder.swift b/BFS/WordLadder.swift index b4f296d9..005b3465 100644 --- a/BFS/WordLadder.swift +++ b/BFS/WordLadder.swift @@ -48,3 +48,45 @@ class WordLadder { return 0 } } +//c++ code of word ladder +class Solution { +public: + int ladderLength(string beginWord, string endWord, vector& wordList) { + set s; + for(int i=0;i q; + q.push(beginWord); + while(!q.empty()) + { + level++; + int siz=q.size(); + for(int i=0;i