From d07c35e91f53d047944acda25d50fd7da14ff732 Mon Sep 17 00:00:00 2001 From: Sayandev Santra <86231984+SayandevSantra@users.noreply.github.com> Date: Mon, 30 Oct 2023 19:51:11 +0530 Subject: [PATCH] Create sum-of-xor-of-all-pairs.cpp --- sum-of-xor-of-all-pairs.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 sum-of-xor-of-all-pairs.cpp diff --git a/sum-of-xor-of-all-pairs.cpp b/sum-of-xor-of-all-pairs.cpp new file mode 100644 index 00000000..4814c767 --- /dev/null +++ b/sum-of-xor-of-all-pairs.cpp @@ -0,0 +1,27 @@ +class Solution{ + public: + // Returns sum of bitwise OR + // of all pairs + long long int sumXOR(int arr[], int n) + { + + ll sum=0; + for(int i=0;i<31;i++) + { + ll one=0; + ll zero=0; + + for(int j=0;j