Wednesday, 18 December 2024

Terq

 Terq is an online learning platform dedicated to empowering individuals through education. By offering a diverse range of courses, Terq aims to equip learners with the skills and knowledge necessary to excel in their careers and personal development.

Explore Terq's Course Offerings

Terq provides a variety of courses across multiple disciplines, including:

  • Technical Courses: Designed to enhance technical skills, these courses cover topics such as programming, data analysis, and cybersecurity.

  • English Language Courses: Improve your proficiency in English with courses focusing on grammar, vocabulary, and communication skills.

  • Reasoning and Quantitative Courses: Sharpen your analytical abilities with courses that delve into logical reasoning and quantitative aptitude.

Why Choose Terq?

  • Comprehensive Learning: Each course is meticulously crafted to provide in-depth knowledge and practical skills.

  • Expert Instructors: Learn from industry professionals and experienced educators who bring real-world insights into the classroom.

  • Flexible Learning: Access course materials anytime, anywhere, allowing you to learn at your own pace.

  • Interactive Platform: Engage with interactive content, quizzes, and discussion forums to enhance your learning experience.

Getting Started with Terq

Embarking on your learning journey with Terq is simple:

  1. Visit the Website: Navigate to terq.in to explore the available courses.

  2. Select a Course: Browse through the course catalog and choose the one that aligns with your learning goals.

  3. Enroll: Sign up for the course and gain immediate access to all learning materials.

  4. Begin Learning: Start your educational journey and work towards achieving your personal and professional objectives.

Join the Terq Community

By choosing Terq, you become part of a community committed to continuous learning and growth. Whether you're looking to advance in your career, acquire new skills, or pursue a personal interest, Terq provides the resources and support you need to succeed.

Visit terq.in today and take the first step towards building a better tomorrow through learning.

Friday, 20 September 2024

Subarray Sum Visualizer with Animation

Subarray Sum Visualizer with Animation

560. Subarray Sum Equals K

Given an array of integers nums and an integer k, return the total number of subarrays whose sum equals to k.

A subarray is a contiguous non-empty sequence of elements within an array.

Example 1:

Input: nums = [1, 1, 1], k = 2

Output: 2

Example 2:

Input: nums = [1, 2, 3], k = 3

Output: 2

Constraints:

  • 1 <=n ums.length <=2 * 104
  • -1000 <=n ums[i] <=1 000
  • -107 <=k <=1 07

Difficulty: Medium | Topics: Arrays, Hashmaps

Enter the array of integers and a target sum (k). The visualizer will show how many subarrays sum up to k.

Java Code: Subarray Sum Equals K

class Solution {
    public int subarraySum(int[] nums, int k) {
        Map<Integer, Integer> map = new HashMap<>();
        map.put(0, 1);
        int count = 0;
        int sum = 0;

        for(int num : nums) {
            sum += num;
            int diff = sum - k;
            if(map.containsKey(diff)) {
                count += map.get(diff);
            }
            map.put(sum, map.getOrDefault(sum, 0) + 1);
        }

        return count;
    }
}
        

Thursday, 19 September 2024

LeetCode 75. Sort Colors: Dutch National Flag Problem Visualizer

Dutch National Flag Problem Visualizer

75. Sort Colors: Dutch National Flag Problem Visualizer

Understanding the Dutch National Flag Problem

The Dutch National Flag problem involves sorting an array containing three distinct values: 0 (red), 1 (white), and 2 (blue). The goal is to sort the array with all elements of the same color adjacent in the order red, white, and blue.

This visualization will help you understand how the sorting algorithm works, step by step:

  • i (current): Tracks the current element being processed.
  • j (left): Marks the position for the next red (0).
  • k (right): Marks the position for the next blue (2).

Terq

 Terq is an online learning platform dedicated to empowering individuals through education. By offering a diverse range of courses, Terq aim...