From f89ceff7aecf6fbef7a189d4e57d73ae02695827 Mon Sep 17 00:00:00 2001 From: chayan das <110921638+Chayandas07@users.noreply.github.com> Date: Sun, 30 Mar 2025 20:16:06 +0530 Subject: [PATCH] Create 763. Partition Labels --- 763. Partition Labels | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 763. Partition Labels diff --git a/763. Partition Labels b/763. Partition Labels new file mode 100644 index 0000000..4a558fa --- /dev/null +++ b/763. Partition Labels @@ -0,0 +1,23 @@ +class Solution { +public: + vector partitionLabels(string s) { + vector ans; + vector last(26, 0); + for (int i = 0; i < s.size(); i++) { + last[s[i] - 'a'] = i; + } + set st; + int partitionStart = 0; + for(int i=0;i