Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7034017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:08:06+00:00 2026-05-28T01:08:06+00:00

I need help fixing a very simple brute force attack on a set of

  • 0

I need help fixing a very simple brute force attack on a set of numbers 1=9. My goal is to solve a sudoko board where a row is filled with 8 numbers so that there can only be one number left on the row. The only way that I thought of to find this was to assign a number to the missing cell and then check it against every other number on the row. I’m really close to the solution but the return is always a 1. Here’s the snippet of code that I’m having problems with: I updated the code so that it now adds all the numbers and subtracts them from 45 to find the right number. It still doesn’t return the right number. It returns 423 (With 6 as the missing number).

int radd1=deduct[0][0]+deduct[0][1]+deduct[0][2]+deduct[0][3]+deduct[0][4]+deduct[0] int test=0;
if (radd1==8) {
    for (int control=0; control<9; control++) {
        if (dash[0][control]=='_') {
            empty=control;
        }
    }
    for (int control2=0; control2<9; control2++) {
        if (control2!=empty) {
            test=test+dash[0][control2];
        }
    }
    cout << test << endl;
}

Some more info:
The entire solve is based off of one 9×9 char filled with numbers to go in their appropriate spots. This char is called dash[9][9].
The deduct[9][9] char is a duplicate of dash[9][9] except that instead of the actual number that goes there, there is a 1. This is so I can add up a whole row and if it is equal to 8 perform my simple brute force (if that’s the right term) to find the final ninth number. empty is an int. It stores (in this case) the column number that has no number.
Spot any problems?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T01:08:07+00:00Added an answer on May 28, 2026 at 1:08 am
    1. It’s a mistake to be using deduct[0][9] in the addition of radd1, right?
    2. The comparison with dash[0][control3] is inside a cycle so that the value of test is always dependant in the last iteration of the cycle. (In this case control2+1 vs dash[0][8]. I suppose you’d have to break the cycle if there is an equality.
    3. You assign control2+'1' to dash[0][empty] but later use control+1. (Not the same thing)
    4. The whole assignment and comparison inside the condition if (test==1) doesn’t feel right but we can’t be sure if it’s correct just from the included code.

    There is a better way of finding the number that has not been used. We know the sum of 1+2+..+9 = 45, so you’d only have to sum the appearing numbers and substract from 45 to obtain the number that’s missing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need some help in fixing the below issue. I had transaction blocks in
I have the following code. I need help fixing it such that the Category
I need some help fixing a cross-thread exception. I am using Invoke which usually
postgresql python I need some help fixing some issues with a postgresql database I
I need help fixing the following error when I run my webapp: com.google.appengine.tools.development.LocalResourceFileServlet doGet
I have two problems with the below code that I need help fixing: 1)
need help to create regular expression matching string www.*.abc.*/somestring Here * is wild card
Need help writing a script downloads data from google insight using c# this is
I need help on this following aspx code aspx Code: <asp:Label ID =lblName runat
I need help understanding some C++ operator overload statements. The class is declared like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.